Re #1655: Initial implementation of pjsua CLI app for Symbian.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4477 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip-apps/src/pjsua/symbian/inc/PjsuaContainerView.h b/pjsip-apps/src/pjsua/symbian/inc/PjsuaContainerView.h
new file mode 100644
index 0000000..22b3ed8
--- /dev/null
+++ b/pjsip-apps/src/pjsua/symbian/inc/PjsuaContainerView.h
@@ -0,0 +1,94 @@
+/*
+========================================================================
+ Name        : PjsuaContainerView.h
+ Author      : nanang
+ Copyright   : Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
+ Description : 
+========================================================================
+*/
+#ifndef PJSUACONTAINERVIEW_H
+#define PJSUACONTAINERVIEW_H
+
+// [[[ begin generated region: do not modify [Generated Includes]
+#include <aknview.h>
+// ]]] end generated region [Generated Includes]
+
+
+// [[[ begin [Event Handler Includes]
+// ]]] end [Event Handler Includes]
+
+// [[[ begin generated region: do not modify [Generated Constants]
+// ]]] end generated region [Generated Constants]
+
+// [[[ begin generated region: do not modify [Generated Forward Declarations]
+class CPjsuaContainer;
+// ]]] end generated region [Generated Forward Declarations]
+
+/**
+ * Avkon view class for pjsuaContainerView. It is register with the view server
+ * by the AppUi. It owns the container control.
+ * @class	CpjsuaContainerView pjsuaContainerView.h
+ */						
+			
+class CpjsuaContainerView : public CAknView
+	{
+	
+	
+	// [[[ begin [Public Section]
+public:
+	// constructors and destructor
+	CpjsuaContainerView();
+	static CpjsuaContainerView* NewL();
+	static CpjsuaContainerView* NewLC();        
+	void ConstructL();
+	virtual ~CpjsuaContainerView();
+						
+	// from base class CAknView
+	TUid Id() const;
+	void HandleCommandL( TInt aCommand );
+	
+	// [[[ begin generated region: do not modify [Generated Methods]
+	CPjsuaContainer* CreateContainerL();
+	// ]]] end generated region [Generated Methods]
+	
+	// ]]] end [Public Section]
+	
+	void PutMessage( const char *msg );
+	
+	// [[[ begin [Protected Section]
+protected:
+	// from base class CAknView
+	void DoActivateL(
+		const TVwsViewId& aPrevViewId,
+		TUid aCustomMessageId,
+		const TDesC8& aCustomMessage );
+	void DoDeactivate();
+	void HandleStatusPaneSizeChange();
+	
+	// [[[ begin generated region: do not modify [Overridden Methods]
+	// ]]] end generated region [Overridden Methods]
+	
+	
+	// [[[ begin [User Handlers]
+	// ]]] end [User Handlers]
+	
+	// ]]] end [Protected Section]
+	
+	
+	// [[[ begin [Private Section]
+private:
+	void SetupStatusPaneL();
+	void CleanupStatusPane();
+	
+	// [[[ begin generated region: do not modify [Generated Instance Variables]
+	CPjsuaContainer* iPjsuaContainer;
+	// ]]] end generated region [Generated Instance Variables]
+	
+	// [[[ begin generated region: do not modify [Generated Methods]
+	// ]]] end generated region [Generated Methods]
+	
+	// ]]] end [Private Section]
+	
+	};
+
+#endif // PJSUACONTAINERVIEW_H
diff --git a/pjsip-apps/src/pjsua/symbian/inc/pjsua.hrh b/pjsip-apps/src/pjsua/symbian/inc/pjsua.hrh
new file mode 100644
index 0000000..ba27f50
--- /dev/null
+++ b/pjsip-apps/src/pjsua/symbian/inc/pjsua.hrh
@@ -0,0 +1,12 @@
+/*
+========================================================================
+ Name        : pjsua.hrh
+ Author      : nanang
+ Copyright   : Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
+ Description : 
+========================================================================
+*/
+enum TpjsuaViewUids
+	{
+	EPjsuaContainerViewId = 1
+	};
diff --git a/pjsip-apps/src/pjsua/symbian/inc/pjsua.pan b/pjsip-apps/src/pjsua/symbian/inc/pjsua.pan
new file mode 100644
index 0000000..e33dbd5
--- /dev/null
+++ b/pjsip-apps/src/pjsua/symbian/inc/pjsua.pan
@@ -0,0 +1,18 @@
+
+#ifndef PJSUA_PAN_H
+#define PJSUA_PAN_H
+
+/** pjsua application panic codes */
+enum TpjsuaPanics
+	{
+	EpjsuaUi = 1
+	// add further panics here
+	};
+
+inline void Panic(TpjsuaPanics aReason)
+	{
+	_LIT(applicationName,"pjsua");
+	User::Panic(applicationName, aReason);
+	}
+
+#endif // PJSUA_PAN_H
diff --git a/pjsip-apps/src/pjsua/symbian/inc/pjsuaAppUi.h b/pjsip-apps/src/pjsua/symbian/inc/pjsuaAppUi.h
new file mode 100644
index 0000000..8bfd244
--- /dev/null
+++ b/pjsip-apps/src/pjsua/symbian/inc/pjsuaAppUi.h
@@ -0,0 +1,70 @@
+/*
+========================================================================
+ Name        : pjsuaAppUi.h
+ Author      : nanang
+ Copyright   : Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
+ Description : 
+========================================================================
+*/
+#ifndef PJSUAAPPUI_H
+#define PJSUAAPPUI_H
+
+// [[[ begin generated region: do not modify [Generated Includes]
+#include <aknviewappui.h>
+// ]]] end generated region [Generated Includes]
+
+
+// [[[ begin generated region: do not modify [Generated Forward Declarations]
+class CpjsuaContainerView;
+// ]]] end generated region [Generated Forward Declarations]
+
+/**
+ * @class	CpjsuaAppUi pjsuaAppUi.h
+ * @brief The AppUi class handles application-wide aspects of the user interface, including
+ *        view management and the default menu, control pane, and status pane.
+ */
+class CpjsuaAppUi : public CAknViewAppUi
+	{
+public: 
+	// constructor and destructor
+	CpjsuaAppUi();
+	virtual ~CpjsuaAppUi();
+	void ConstructL();
+
+public:
+	// from CCoeAppUi
+	TKeyResponse HandleKeyEventL(
+				const TKeyEvent& aKeyEvent,
+				TEventCode aType );
+
+	// from CEikAppUi
+	void HandleCommandL( TInt aCommand );
+	void HandleResourceChangeL( TInt aType );
+
+	// from CAknAppUi
+	void HandleViewDeactivation( 
+			const TVwsViewId& aViewIdToBeDeactivated, 
+			const TVwsViewId& aNewlyActivatedViewId );
+
+private:
+	void InitializeContainersL();
+	// [[[ begin generated region: do not modify [Generated Methods]
+public: 
+	// ]]] end generated region [Generated Methods]
+	
+	void PutMsg(const char *msg);
+	
+	// [[[ begin generated region: do not modify [Generated Instance Variables]
+private: 
+	CpjsuaContainerView* iPjsuaContainerView;
+	// ]]] end generated region [Generated Instance Variables]
+	
+	
+	// [[[ begin [User Handlers]
+protected: 
+	// ]]] end [User Handlers]
+	void PrepareToExit();
+
+	};
+
+#endif // PJSUAAPPUI_H			
diff --git a/pjsip-apps/src/pjsua/symbian/inc/pjsuaApplication.h b/pjsip-apps/src/pjsua/symbian/inc/pjsuaApplication.h
new file mode 100644
index 0000000..eef6e3f
--- /dev/null
+++ b/pjsip-apps/src/pjsua/symbian/inc/pjsuaApplication.h
@@ -0,0 +1,35 @@
+/*
+========================================================================
+ Name        : pjsuaApplication.h
+ Author      : nanang
+ Copyright   : Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
+ Description : 
+========================================================================
+*/
+#ifndef PJSUAAPPLICATION_H
+#define PJSUAAPPLICATION_H
+
+// [[[ begin generated region: do not modify [Generated Includes]
+#include <aknapp.h>
+// ]]] end generated region [Generated Includes]
+
+// [[[ begin generated region: do not modify [Generated Constants]
+const TUid KUidpjsuaApplication = { 0xE44C2D02 };
+// ]]] end generated region [Generated Constants]
+
+/**
+ *
+ * @class	CpjsuaApplication pjsuaApplication.h
+ * @brief	A CAknApplication-derived class is required by the S60 application 
+ *          framework. It is subclassed to create the application's document 
+ *          object.
+ */
+class CpjsuaApplication : public CAknApplication
+	{
+private:
+	TUid AppDllUid() const;
+	CApaDocument* CreateDocumentL();
+	
+	};
+			
+#endif // PJSUAAPPLICATION_H		
diff --git a/pjsip-apps/src/pjsua/symbian/inc/pjsuaContainer.h b/pjsip-apps/src/pjsua/symbian/inc/pjsuaContainer.h
new file mode 100644
index 0000000..2ee1475
--- /dev/null
+++ b/pjsip-apps/src/pjsua/symbian/inc/pjsuaContainer.h
@@ -0,0 +1,112 @@
+/*
+========================================================================
+ Name        : pjsuaContainer.h
+ Author      : nanang
+ Copyright   : Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
+ Description : 
+========================================================================
+*/
+#ifndef PJSUACONTAINER_H
+#define PJSUACONTAINER_H
+
+// [[[ begin generated region: do not modify [Generated Includes]
+#include <coecntrl.h>		
+// ]]] end generated region [Generated Includes]
+
+
+// [[[ begin [Event Handler Includes]
+// ]]] end [Event Handler Includes]
+
+// [[[ begin generated region: do not modify [Generated Forward Declarations]
+class MEikCommandObserver;		
+class CEikImage;
+class CEikLabel;
+// ]]] end generated region [Generated Forward Declarations]
+
+/**
+ * Container class for pjsuaContainer
+ * 
+ * @class	CPjsuaContainer pjsuaContainer.h
+ */
+class CPjsuaContainer : public CCoeControl
+	{
+public:
+	// constructors and destructor
+	CPjsuaContainer();
+	static CPjsuaContainer* NewL( 
+		const TRect& aRect, 
+		const CCoeControl* aParent, 
+		MEikCommandObserver* aCommandObserver );
+	static CPjsuaContainer* NewLC( 
+		const TRect& aRect, 
+		const CCoeControl* aParent, 
+		MEikCommandObserver* aCommandObserver );
+	void ConstructL( 
+		const TRect& aRect, 
+		const CCoeControl* aParent, 
+		MEikCommandObserver* aCommandObserver );
+	virtual ~CPjsuaContainer();
+
+public:
+	// from base class CCoeControl
+	TInt CountComponentControls() const;
+	CCoeControl* ComponentControl( TInt aIndex ) const;
+	TKeyResponse OfferKeyEventL( 
+			const TKeyEvent& aKeyEvent, 
+			TEventCode aType );
+	void HandleResourceChange( TInt aType );
+	
+protected:
+	// from base class CCoeControl
+	void SizeChanged();
+
+private:
+	// from base class CCoeControl
+	void Draw( const TRect& aRect ) const;
+
+private:
+	void InitializeControlsL();
+	void LayoutControls();
+	CCoeControl* iFocusControl;
+	MEikCommandObserver* iCommandObserver;
+	// [[[ begin generated region: do not modify [Generated Methods]
+public: 
+	// ]]] end generated region [Generated Methods]
+	
+	void PutMessageL( const char* msg );
+	// [[[ begin generated region: do not modify [Generated Type Declarations]
+public: 
+	// ]]] end generated region [Generated Type Declarations]
+	
+	// [[[ begin generated region: do not modify [Generated Instance Variables]
+private: 
+	CEikImage* iImage1;
+	CEikLabel* iLabel1;
+	// ]]] end generated region [Generated Instance Variables]
+	
+	
+	// [[[ begin [Overridden Methods]
+protected: 
+	// ]]] end [Overridden Methods]
+	
+	
+	// [[[ begin [User Handlers]
+protected: 
+	// ]]] end [User Handlers]
+	
+public: 
+	enum TControls
+		{
+		// [[[ begin generated region: do not modify [Generated Contents]
+		EImage1,
+		ELabel1,
+		
+		// ]]] end generated region [Generated Contents]
+		
+		// add any user-defined entries here...
+		
+		ELastControl
+		};
+	};
+				
+#endif // PJSUACONTAINER_H
diff --git a/pjsip-apps/src/pjsua/symbian/inc/pjsuaDocument.h b/pjsip-apps/src/pjsua/symbian/inc/pjsuaDocument.h
new file mode 100644
index 0000000..be5deff
--- /dev/null
+++ b/pjsip-apps/src/pjsua/symbian/inc/pjsuaDocument.h
@@ -0,0 +1,36 @@
+/*
+========================================================================
+ Name        : pjsuaDocument.h
+ Author      : nanang
+ Copyright   : Copyright (C) 2013 Teluu Inc. (http://www.teluu.com)
+ Description : 
+========================================================================
+*/
+#ifndef PJSUADOCUMENT_H
+#define PJSUADOCUMENT_H
+
+#include <akndoc.h>
+		
+class CEikAppUi;
+
+/**
+* @class	CpjsuaDocument pjsuaDocument.h
+* @brief	A CAknDocument-derived class is required by the S60 application 
+*           framework. It is responsible for creating the AppUi object. 
+*/
+class CpjsuaDocument : public CAknDocument
+	{
+public: 
+	// constructor
+	static CpjsuaDocument* NewL( CEikApplication& aApp );
+
+private: 
+	// constructors
+	CpjsuaDocument( CEikApplication& aApp );
+	void ConstructL();
+	
+public: 
+	// from base class CEikDocument
+	CEikAppUi* CreateAppUiL();
+	};
+#endif // PJSUADOCUMENT_H