1 /*
2  * $Id: gnapplet_ui.cpp,v 1.2 2005/04/12 20:18:24 bozo Exp $
3  *
4  * G N A P P L E T
5  *
6  * gnapplet is a gnbus protocol driver for symbian phones.
7  *
8  * This file is part of gnokii.
9  *
10  * Gnokii is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * Gnokii is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with gnokii; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  *
24  * Copyright (C) 2004 BORBELY Zoltan
25  *
26  * This file contains a frontent to the real application.
27  *
28  */
29 
30 #include "gnapplet_ui.h"
31 
32 
E32Dll(TDllReason)33 GLDEF_C TInt E32Dll(TDllReason)
34 {
35 	return KErrNone;
36 }
37 
NewApplication(void)38 EXPORT_C CApaApplication *NewApplication(void)
39 {
40 	return new CGNAppletApplication;
41 }
42 
43 /* ------------------------------------------------------------------------- */
44 
CreateDocumentL(void)45 CApaDocument *CGNAppletApplication::CreateDocumentL(void)
46 {
47 	return new (ELeave)CGNAppletDocument(*this);
48 }
49 
AppDllUid(void) const50 TUid CGNAppletApplication::AppDllUid(void) const
51 {
52 	TUid id = { 0x107d4df2 };	/* UID3 */
53 
54 	return id;
55 }
56 
57 /* ------------------------------------------------------------------------- */
58 
CreateAppUiL(void)59 CEikAppUi *CGNAppletDocument::CreateAppUiL(void)
60 {
61 	return new (ELeave)CGNAppletAppUi;
62 }
63 
64 /* ------------------------------------------------------------------------- */
65 
ConstructL(void)66 void CGNAppletAppUi::ConstructL(void)
67 {
68 	TFileName file;
69 	int pos;
70 
71 	BaseConstructL(ENoAppResourceFile);
72 
73 	file.Copy(Application()->AppFullName());
74 	pos = file.LocateReverse('\\');
75 	file.Replace(pos, file.Length() - pos, _L("\\gnapplet.exe"));
76 
77 	EikDll::StartExeL(file);
78 
79 	User::Exit(0);
80 }
81