diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2011-05-05 05:10:06 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2011-05-05 05:10:06 +0000 |
commit | f20f56c4f36dfdac81218436cc19c5a6c0b3cc79 (patch) | |
tree | a6c14b605d1e69cfb4a55bfd3baf840367115c75 /pjsip-apps/src | |
parent | 343c2d795a16550e42e99ae8c0b20ccbc8fa2f25 (diff) |
Re #1175: Set SVN properties for several files: keywords=id and eol-style=native
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3549 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
16 files changed, 2631 insertions, 2631 deletions
diff --git a/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h b/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h index c805f174..dc8d7896 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/Symbian_ua_guiSettingItemListSettings.h @@ -1,63 +1,63 @@ -/*
-========================================================================
- Name : Symbian_ua_guiSettingItemListSettings.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUISETTINGITEMLISTSETTINGS_H
-#define SYMBIAN_UA_GUISETTINGITEMLISTSETTINGS_H
-
-// [[[ begin generated region: do not modify [Generated Includes]
-#include <e32std.h>
-// ]]] end generated region [Generated Includes]
-
-// [[[ begin generated region: do not modify [Generated Constants]
-const int KEd_registrarMaxLength = 255;
-const int KEd_userMaxLength = 255;
-const int KEd_passwordMaxLength = 32;
-const int KEd_stun_serverMaxLength = 255;
-// ]]] end generated region [Generated Constants]
-
-/**
- * @class TSymbian_ua_guiSettingItemListSettings Symbian_ua_guiSettingItemListSettings.h
- */
-class TSymbian_ua_guiSettingItemListSettings
- {
-public:
- // construct and destroy
- static TSymbian_ua_guiSettingItemListSettings* NewL();
- void ConstructL();
-
-private:
- // constructor
- TSymbian_ua_guiSettingItemListSettings();
- // [[[ begin generated region: do not modify [Generated Accessors]
-public:
- TDes& Ed_registrar();
- void SetEd_registrar(const TDesC& aValue);
- TDes& Ed_user();
- void SetEd_user(const TDesC& aValue);
- TDes& Ed_password();
- void SetEd_password(const TDesC& aValue);
- TBool& B_srtp();
- void SetB_srtp(const TBool& aValue);
- TBool& B_ice();
- void SetB_ice(const TBool& aValue);
- TDes& Ed_stun_server();
- void SetEd_stun_server(const TDesC& aValue);
- // ]]] end generated region [Generated Accessors]
-
- // [[[ begin generated region: do not modify [Generated Members]
-protected:
- TBuf<KEd_registrarMaxLength> iEd_registrar;
- TBuf<KEd_userMaxLength> iEd_user;
- TBuf<KEd_passwordMaxLength> iEd_password;
- TBool iB_srtp;
- TBool iB_ice;
- TBuf<KEd_stun_serverMaxLength> iEd_stun_server;
- // ]]] end generated region [Generated Members]
-
- };
-#endif // SYMBIAN_UA_GUISETTINGITEMLISTSETTINGS_H
+/* +======================================================================== + Name : Symbian_ua_guiSettingItemListSettings.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUISETTINGITEMLISTSETTINGS_H +#define SYMBIAN_UA_GUISETTINGITEMLISTSETTINGS_H + +// [[[ begin generated region: do not modify [Generated Includes] +#include <e32std.h> +// ]]] end generated region [Generated Includes] + +// [[[ begin generated region: do not modify [Generated Constants] +const int KEd_registrarMaxLength = 255; +const int KEd_userMaxLength = 255; +const int KEd_passwordMaxLength = 32; +const int KEd_stun_serverMaxLength = 255; +// ]]] end generated region [Generated Constants] + +/** + * @class TSymbian_ua_guiSettingItemListSettings Symbian_ua_guiSettingItemListSettings.h + */ +class TSymbian_ua_guiSettingItemListSettings + { +public: + // construct and destroy + static TSymbian_ua_guiSettingItemListSettings* NewL(); + void ConstructL(); + +private: + // constructor + TSymbian_ua_guiSettingItemListSettings(); + // [[[ begin generated region: do not modify [Generated Accessors] +public: + TDes& Ed_registrar(); + void SetEd_registrar(const TDesC& aValue); + TDes& Ed_user(); + void SetEd_user(const TDesC& aValue); + TDes& Ed_password(); + void SetEd_password(const TDesC& aValue); + TBool& B_srtp(); + void SetB_srtp(const TBool& aValue); + TBool& B_ice(); + void SetB_ice(const TBool& aValue); + TDes& Ed_stun_server(); + void SetEd_stun_server(const TDesC& aValue); + // ]]] end generated region [Generated Accessors] + + // [[[ begin generated region: do not modify [Generated Members] +protected: + TBuf<KEd_registrarMaxLength> iEd_registrar; + TBuf<KEd_userMaxLength> iEd_user; + TBuf<KEd_passwordMaxLength> iEd_password; + TBool iB_srtp; + TBool iB_ice; + TBuf<KEd_stun_serverMaxLength> iEd_stun_server; + // ]]] end generated region [Generated Members] + + }; +#endif // SYMBIAN_UA_GUISETTINGITEMLISTSETTINGS_H diff --git a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h index be27309f..6fe7a8b8 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiAppUi.h @@ -1,119 +1,119 @@ -/*
-========================================================================
- Name : symbian_ua_guiAppUi.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUIAPPUI_H
-#define SYMBIAN_UA_GUIAPPUI_H
-
-// [[[ begin generated region: do not modify [Generated Includes]
-#include <aknviewappui.h>
-#include <aknwaitdialog.h>
-// ]]] end generated region [Generated Includes]
-
-// [[[ begin generated region: do not modify [Generated Forward Declarations]
-class Csymbian_ua_guiContainerView;
-class Csymbian_ua_guiSettingItemListView;
-// ]]] end generated region [Generated Forward Declarations]
-
-/**
- * @class Csymbian_ua_guiAppUi symbian_ua_guiAppUi.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 Csymbian_ua_guiAppUi : public CAknViewAppUi, public CTimer
- {
-public:
- // constructor and destructor
- Csymbian_ua_guiAppUi();
- virtual ~Csymbian_ua_guiAppUi();
- 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:
- void ExecuteDlg_wait_initLD( const TDesC* aOverrideText = NULL );
- void RemoveDlg_wait_initL();
- // ]]] end generated region [Generated Methods]
-
- // [[[ begin generated region: do not modify [Generated Instance Variables]
-private:
- CAknWaitDialog* iDlg_wait_init;
- class CProgressDialogCallback;
- CProgressDialogCallback* iDlg_wait_initCallback;
- Csymbian_ua_guiContainerView* iSymbian_ua_guiContainerView;
- Csymbian_ua_guiSettingItemListView* iSymbian_ua_guiSettingItemListView;
- // ]]] end generated region [Generated Instance Variables]
-
-
- // [[[ begin [User Handlers]
-protected:
- void HandleSymbian_ua_guiAppUiApplicationSpecificEventL(
- TInt aType,
- const TWsEvent& anEvent );
- void HandleDlg_wait_initCanceledL( CAknProgressDialog* aDialog );
- // ]]] end [User Handlers]
-
-
- // [[[ begin [Overridden Methods]
-protected:
- void HandleApplicationSpecificEventL(
- TInt aType,
- const TWsEvent& anEvent );
- // ]]] end [Overridden Methods]
-
- virtual void RunL();
-
- // [[[ begin [MProgressDialogCallback support]
-private:
- typedef void ( Csymbian_ua_guiAppUi::*ProgressDialogEventHandler )(
- CAknProgressDialog* aProgressDialog );
-
- /**
- * This is a helper class for progress/wait dialog callbacks. It routes the dialog's
- * cancel notification to the handler function for the cancel event.
- */
- class CProgressDialogCallback : public CBase, public MProgressDialogCallback
- {
- public:
- CProgressDialogCallback(
- Csymbian_ua_guiAppUi* aHandlerObj,
- CAknProgressDialog* aDialog,
- ProgressDialogEventHandler aHandler ) :
- handlerObj( aHandlerObj ), dialog( aDialog ), handler( aHandler )
- {}
-
- void DialogDismissedL( TInt aButtonId )
- {
- ( handlerObj->*handler )( dialog );
- }
- private:
- Csymbian_ua_guiAppUi* handlerObj;
- CAknProgressDialog* dialog;
- ProgressDialogEventHandler handler;
- };
-
- // ]]] end [MProgressDialogCallback support]
-
- };
-
-#endif // SYMBIAN_UA_GUIAPPUI_H
+/* +======================================================================== + Name : symbian_ua_guiAppUi.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUIAPPUI_H +#define SYMBIAN_UA_GUIAPPUI_H + +// [[[ begin generated region: do not modify [Generated Includes] +#include <aknviewappui.h> +#include <aknwaitdialog.h> +// ]]] end generated region [Generated Includes] + +// [[[ begin generated region: do not modify [Generated Forward Declarations] +class Csymbian_ua_guiContainerView; +class Csymbian_ua_guiSettingItemListView; +// ]]] end generated region [Generated Forward Declarations] + +/** + * @class Csymbian_ua_guiAppUi symbian_ua_guiAppUi.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 Csymbian_ua_guiAppUi : public CAknViewAppUi, public CTimer + { +public: + // constructor and destructor + Csymbian_ua_guiAppUi(); + virtual ~Csymbian_ua_guiAppUi(); + 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: + void ExecuteDlg_wait_initLD( const TDesC* aOverrideText = NULL ); + void RemoveDlg_wait_initL(); + // ]]] end generated region [Generated Methods] + + // [[[ begin generated region: do not modify [Generated Instance Variables] +private: + CAknWaitDialog* iDlg_wait_init; + class CProgressDialogCallback; + CProgressDialogCallback* iDlg_wait_initCallback; + Csymbian_ua_guiContainerView* iSymbian_ua_guiContainerView; + Csymbian_ua_guiSettingItemListView* iSymbian_ua_guiSettingItemListView; + // ]]] end generated region [Generated Instance Variables] + + + // [[[ begin [User Handlers] +protected: + void HandleSymbian_ua_guiAppUiApplicationSpecificEventL( + TInt aType, + const TWsEvent& anEvent ); + void HandleDlg_wait_initCanceledL( CAknProgressDialog* aDialog ); + // ]]] end [User Handlers] + + + // [[[ begin [Overridden Methods] +protected: + void HandleApplicationSpecificEventL( + TInt aType, + const TWsEvent& anEvent ); + // ]]] end [Overridden Methods] + + virtual void RunL(); + + // [[[ begin [MProgressDialogCallback support] +private: + typedef void ( Csymbian_ua_guiAppUi::*ProgressDialogEventHandler )( + CAknProgressDialog* aProgressDialog ); + + /** + * This is a helper class for progress/wait dialog callbacks. It routes the dialog's + * cancel notification to the handler function for the cancel event. + */ + class CProgressDialogCallback : public CBase, public MProgressDialogCallback + { + public: + CProgressDialogCallback( + Csymbian_ua_guiAppUi* aHandlerObj, + CAknProgressDialog* aDialog, + ProgressDialogEventHandler aHandler ) : + handlerObj( aHandlerObj ), dialog( aDialog ), handler( aHandler ) + {} + + void DialogDismissedL( TInt aButtonId ) + { + ( handlerObj->*handler )( dialog ); + } + private: + Csymbian_ua_guiAppUi* handlerObj; + CAknProgressDialog* dialog; + ProgressDialogEventHandler handler; + }; + + // ]]] end [MProgressDialogCallback support] + + }; + +#endif // SYMBIAN_UA_GUIAPPUI_H diff --git a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h index 26cb7b8a..c1292123 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiApplication.h @@ -1,35 +1,35 @@ -/*
-========================================================================
- Name : symbian_ua_guiApplication.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUIAPPLICATION_H
-#define SYMBIAN_UA_GUIAPPLICATION_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 KUidsymbian_ua_guiApplication = { 0xEBD12EE4 };
-// ]]] end generated region [Generated Constants]
-
-/**
- *
- * @class Csymbian_ua_guiApplication symbian_ua_guiApplication.h
- * @brief A CAknApplication-derived class is required by the S60 application
- * framework. It is subclassed to create the application's document
- * object.
- */
-class Csymbian_ua_guiApplication : public CAknApplication
- {
-private:
- TUid AppDllUid() const;
- CApaDocument* CreateDocumentL();
-
- };
-
-#endif // SYMBIAN_UA_GUIAPPLICATION_H
+/* +======================================================================== + Name : symbian_ua_guiApplication.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUIAPPLICATION_H +#define SYMBIAN_UA_GUIAPPLICATION_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 KUidsymbian_ua_guiApplication = { 0xEBD12EE4 }; +// ]]] end generated region [Generated Constants] + +/** + * + * @class Csymbian_ua_guiApplication symbian_ua_guiApplication.h + * @brief A CAknApplication-derived class is required by the S60 application + * framework. It is subclassed to create the application's document + * object. + */ +class Csymbian_ua_guiApplication : public CAknApplication + { +private: + TUid AppDllUid() const; + CApaDocument* CreateDocumentL(); + + }; + +#endif // SYMBIAN_UA_GUIAPPLICATION_H diff --git a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h index 465496c9..ca3b394e 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainer.h @@ -1,113 +1,113 @@ -/*
-========================================================================
- Name : symbian_ua_guiContainer.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUICONTAINER_H
-#define SYMBIAN_UA_GUICONTAINER_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 CEikLabel;
-class CEikEdwin;
-// ]]] end generated region [Generated Forward Declarations]
-
-/**
- * Container class for symbian_ua_guiContainer
- *
- * @class CSymbian_ua_guiContainer symbian_ua_guiContainer.h
- */
-class CSymbian_ua_guiContainer : public CCoeControl
- {
-public:
- // constructors and destructor
- CSymbian_ua_guiContainer();
- static CSymbian_ua_guiContainer* NewL(
- const TRect& aRect,
- const CCoeControl* aParent,
- MEikCommandObserver* aCommandObserver );
- static CSymbian_ua_guiContainer* NewLC(
- const TRect& aRect,
- const CCoeControl* aParent,
- MEikCommandObserver* aCommandObserver );
- void ConstructL(
- const TRect& aRect,
- const CCoeControl* aParent,
- MEikCommandObserver* aCommandObserver );
- virtual ~CSymbian_ua_guiContainer();
-
-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]
-
- // [[[ 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:
- CEikLabel* iLabel1;
- CEikEdwin* iEd_url;
- CEikEdwin* iEd_info;
- // ]]] 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]
- ELabel1,
- EEd_url,
- EEd_info,
-
- // ]]] end generated region [Generated Contents]
-
- // add any user-defined entries here...
-
- ELastControl
- };
- };
-
-#endif // SYMBIAN_UA_GUICONTAINER_H
+/* +======================================================================== + Name : symbian_ua_guiContainer.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUICONTAINER_H +#define SYMBIAN_UA_GUICONTAINER_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 CEikLabel; +class CEikEdwin; +// ]]] end generated region [Generated Forward Declarations] + +/** + * Container class for symbian_ua_guiContainer + * + * @class CSymbian_ua_guiContainer symbian_ua_guiContainer.h + */ +class CSymbian_ua_guiContainer : public CCoeControl + { +public: + // constructors and destructor + CSymbian_ua_guiContainer(); + static CSymbian_ua_guiContainer* NewL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ); + static CSymbian_ua_guiContainer* NewLC( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ); + void ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ); + virtual ~CSymbian_ua_guiContainer(); + +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] + + // [[[ 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: + CEikLabel* iLabel1; + CEikEdwin* iEd_url; + CEikEdwin* iEd_info; + // ]]] 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] + ELabel1, + EEd_url, + EEd_info, + + // ]]] end generated region [Generated Contents] + + // add any user-defined entries here... + + ELastControl + }; + }; + +#endif // SYMBIAN_UA_GUICONTAINER_H diff --git a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h index 4c294c9c..a75187fb 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiContainerView.h @@ -1,88 +1,88 @@ -/*
-========================================================================
- Name : symbian_ua_guiContainerView.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUICONTAINERVIEW_H
-#define SYMBIAN_UA_GUICONTAINERVIEW_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 Forward Declarations]
-class CSymbian_ua_guiContainer;
-// ]]] end generated region [Generated Forward Declarations]
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-/**
- * Avkon view class for symbian_ua_guiContainerView. It is register with the view server
- * by the AppUi. It owns the container control.
- * @class Csymbian_ua_guiContainerView symbian_ua_guiContainerView.h
- */
-class Csymbian_ua_guiContainerView : public CAknView
- {
-public:
- // constructors and destructor
- Csymbian_ua_guiContainerView();
- static Csymbian_ua_guiContainerView* NewL();
- static Csymbian_ua_guiContainerView* NewLC();
- void ConstructL();
- virtual ~Csymbian_ua_guiContainerView();
-
-public:
- // from base class CAknView
- TUid Id() const;
- void HandleCommandL( TInt aCommand );
-
- void PutMessage(const TDesC &msg);
-
-protected:
- // from base class CAknView
- void DoActivateL(
- const TVwsViewId& aPrevViewId,
- TUid aCustomMessageId,
- const TDesC8& aCustomMessage );
- void DoDeactivate();
- void HandleStatusPaneSizeChange();
-
-private:
- void SetupStatusPaneL();
- void CleanupStatusPane();
- // [[[ begin generated region: do not modify [Generated Methods]
-public:
- static void RunNote_errorL( const TDesC* aOverrideText = NULL );
- static void RunNote_infoL( const TDesC* aOverrideText = NULL );
- static void RunNote_warningL( const TDesC* aOverrideText = NULL );
- static TInt RunQry_accept_callL( const TDesC* aOverrideText = NULL );
- // ]]] end generated region [Generated Methods]
-
-
- // [[[ begin [Overridden Methods]
-protected:
- // ]]] end [Overridden Methods]
-
-
- // [[[ begin [User Handlers]
-protected:
- TBool CallSoftKeyPressedL( TInt aCommand );
- TBool HandleSettingMenuItemSelectedL( TInt aCommand );
- // ]]] end [User Handlers]
-
- // [[[ begin generated region: do not modify [Generated Instance Variables]
-private:
- CSymbian_ua_guiContainer* iSymbian_ua_guiContainer;
- // ]]] end generated region [Generated Instance Variables]
-
- };
-
-#endif // SYMBIAN_UA_GUICONTAINERVIEW_H
+/* +======================================================================== + Name : symbian_ua_guiContainerView.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUICONTAINERVIEW_H +#define SYMBIAN_UA_GUICONTAINERVIEW_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 Forward Declarations] +class CSymbian_ua_guiContainer; +// ]]] end generated region [Generated Forward Declarations] + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +/** + * Avkon view class for symbian_ua_guiContainerView. It is register with the view server + * by the AppUi. It owns the container control. + * @class Csymbian_ua_guiContainerView symbian_ua_guiContainerView.h + */ +class Csymbian_ua_guiContainerView : public CAknView + { +public: + // constructors and destructor + Csymbian_ua_guiContainerView(); + static Csymbian_ua_guiContainerView* NewL(); + static Csymbian_ua_guiContainerView* NewLC(); + void ConstructL(); + virtual ~Csymbian_ua_guiContainerView(); + +public: + // from base class CAknView + TUid Id() const; + void HandleCommandL( TInt aCommand ); + + void PutMessage(const TDesC &msg); + +protected: + // from base class CAknView + void DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + void DoDeactivate(); + void HandleStatusPaneSizeChange(); + +private: + void SetupStatusPaneL(); + void CleanupStatusPane(); + // [[[ begin generated region: do not modify [Generated Methods] +public: + static void RunNote_errorL( const TDesC* aOverrideText = NULL ); + static void RunNote_infoL( const TDesC* aOverrideText = NULL ); + static void RunNote_warningL( const TDesC* aOverrideText = NULL ); + static TInt RunQry_accept_callL( const TDesC* aOverrideText = NULL ); + // ]]] end generated region [Generated Methods] + + + // [[[ begin [Overridden Methods] +protected: + // ]]] end [Overridden Methods] + + + // [[[ begin [User Handlers] +protected: + TBool CallSoftKeyPressedL( TInt aCommand ); + TBool HandleSettingMenuItemSelectedL( TInt aCommand ); + // ]]] end [User Handlers] + + // [[[ begin generated region: do not modify [Generated Instance Variables] +private: + CSymbian_ua_guiContainer* iSymbian_ua_guiContainer; + // ]]] end generated region [Generated Instance Variables] + + }; + +#endif // SYMBIAN_UA_GUICONTAINERVIEW_H diff --git a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h index 83012311..49f9bfc3 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiDocument.h @@ -1,36 +1,36 @@ -/*
-========================================================================
- Name : symbian_ua_guiDocument.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUIDOCUMENT_H
-#define SYMBIAN_UA_GUIDOCUMENT_H
-
-#include <akndoc.h>
-
-class CEikAppUi;
-
-/**
-* @class Csymbian_ua_guiDocument symbian_ua_guiDocument.h
-* @brief A CAknDocument-derived class is required by the S60 application
-* framework. It is responsible for creating the AppUi object.
-*/
-class Csymbian_ua_guiDocument : public CAknDocument
- {
-public:
- // constructor
- static Csymbian_ua_guiDocument* NewL( CEikApplication& aApp );
-
-private:
- // constructors
- Csymbian_ua_guiDocument( CEikApplication& aApp );
- void ConstructL();
-
-public:
- // from base class CEikDocument
- CEikAppUi* CreateAppUiL();
- };
-#endif // SYMBIAN_UA_GUIDOCUMENT_H
+/* +======================================================================== + Name : symbian_ua_guiDocument.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUIDOCUMENT_H +#define SYMBIAN_UA_GUIDOCUMENT_H + +#include <akndoc.h> + +class CEikAppUi; + +/** +* @class Csymbian_ua_guiDocument symbian_ua_guiDocument.h +* @brief A CAknDocument-derived class is required by the S60 application +* framework. It is responsible for creating the AppUi object. +*/ +class Csymbian_ua_guiDocument : public CAknDocument + { +public: + // constructor + static Csymbian_ua_guiDocument* NewL( CEikApplication& aApp ); + +private: + // constructors + Csymbian_ua_guiDocument( CEikApplication& aApp ); + void ConstructL(); + +public: + // from base class CEikDocument + CEikAppUi* CreateAppUiL(); + }; +#endif // SYMBIAN_UA_GUIDOCUMENT_H diff --git a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h index bdaa089c..9355f09b 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemList.h @@ -1,87 +1,87 @@ -/*
-========================================================================
- Name : symbian_ua_guiSettingItemList.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUISETTINGITEMLIST_H
-#define SYMBIAN_UA_GUISETTINGITEMLIST_H
-
-// [[[ begin generated region: do not modify [Generated Includes]
-#include <aknsettingitemlist.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 TSymbian_ua_guiSettingItemListSettings;
-// ]]] end generated region [Generated Forward Declarations]
-
-/**
- * @class CSymbian_ua_guiSettingItemList symbian_ua_guiSettingItemList.h
- */
-class CSymbian_ua_guiSettingItemList : public CAknSettingItemList
- {
-public: // constructors and destructor
-
- CSymbian_ua_guiSettingItemList(
- TSymbian_ua_guiSettingItemListSettings& settings,
- MEikCommandObserver* aCommandObserver );
- virtual ~CSymbian_ua_guiSettingItemList();
-
-public:
-
- // from CCoeControl
- void HandleResourceChange( TInt aType );
-
- // overrides of CAknSettingItemList
- CAknSettingItem* CreateSettingItemL( TInt id );
- void EditItemL( TInt aIndex, TBool aCalledFromMenu );
- TKeyResponse OfferKeyEventL(
- const TKeyEvent& aKeyEvent,
- TEventCode aType );
-
-public:
- // utility function for menu
- void ChangeSelectedItemL();
-
- void LoadSettingValuesL();
- void SaveSettingValuesL();
-
-private:
- // override of CAknSettingItemList
- void SizeChanged();
-
-private:
- // current settings values
- TSymbian_ua_guiSettingItemListSettings& iSettings;
- MEikCommandObserver* iCommandObserver;
- // [[[ begin generated region: do not modify [Generated Methods]
-public:
- // ]]] end generated region [Generated Methods]
-
- // [[[ 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:
- // ]]] end generated region [Generated Instance Variables]
-
-
- // [[[ begin [Overridden Methods]
-protected:
- // ]]] end [Overridden Methods]
-
-
- // [[[ begin [User Handlers]
-protected:
- // ]]] end [User Handlers]
-
- };
-#endif // SYMBIAN_UA_GUISETTINGITEMLIST_H
+/* +======================================================================== + Name : symbian_ua_guiSettingItemList.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUISETTINGITEMLIST_H +#define SYMBIAN_UA_GUISETTINGITEMLIST_H + +// [[[ begin generated region: do not modify [Generated Includes] +#include <aknsettingitemlist.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 TSymbian_ua_guiSettingItemListSettings; +// ]]] end generated region [Generated Forward Declarations] + +/** + * @class CSymbian_ua_guiSettingItemList symbian_ua_guiSettingItemList.h + */ +class CSymbian_ua_guiSettingItemList : public CAknSettingItemList + { +public: // constructors and destructor + + CSymbian_ua_guiSettingItemList( + TSymbian_ua_guiSettingItemListSettings& settings, + MEikCommandObserver* aCommandObserver ); + virtual ~CSymbian_ua_guiSettingItemList(); + +public: + + // from CCoeControl + void HandleResourceChange( TInt aType ); + + // overrides of CAknSettingItemList + CAknSettingItem* CreateSettingItemL( TInt id ); + void EditItemL( TInt aIndex, TBool aCalledFromMenu ); + TKeyResponse OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ); + +public: + // utility function for menu + void ChangeSelectedItemL(); + + void LoadSettingValuesL(); + void SaveSettingValuesL(); + +private: + // override of CAknSettingItemList + void SizeChanged(); + +private: + // current settings values + TSymbian_ua_guiSettingItemListSettings& iSettings; + MEikCommandObserver* iCommandObserver; + // [[[ begin generated region: do not modify [Generated Methods] +public: + // ]]] end generated region [Generated Methods] + + // [[[ 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: + // ]]] end generated region [Generated Instance Variables] + + + // [[[ begin [Overridden Methods] +protected: + // ]]] end [Overridden Methods] + + + // [[[ begin [User Handlers] +protected: + // ]]] end [User Handlers] + + }; +#endif // SYMBIAN_UA_GUISETTINGITEMLIST_H diff --git a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h index 18b3f2b1..2d9b261b 100644 --- a/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h +++ b/pjsip-apps/src/symbian_ua_gui/inc/symbian_ua_guiSettingItemListView.h @@ -1,85 +1,85 @@ -/*
-========================================================================
- Name : symbian_ua_guiSettingItemListView.h
- Author : nanang
- Copyright : (c) PJSIP 2008
- Description :
-========================================================================
-*/
-#ifndef SYMBIAN_UA_GUISETTINGITEMLISTVIEW_H
-#define SYMBIAN_UA_GUISETTINGITEMLISTVIEW_H
-
-// [[[ begin generated region: do not modify [Generated Includes]
-#include <aknview.h>
-#include "Symbian_ua_guiSettingItemListSettings.h"
-// ]]] end generated region [Generated Includes]
-
-
-// [[[ begin [Event Handler Includes]
-// ]]] end [Event Handler Includes]
-
-// [[[ begin generated region: do not modify [Generated Forward Declarations]
-class CSymbian_ua_guiSettingItemList;
-// ]]] end generated region [Generated Forward Declarations]
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-/**
- * Avkon view class for symbian_ua_guiSettingItemListView. It is register with the view server
- * by the AppUi. It owns the container control.
- * @class Csymbian_ua_guiSettingItemListView symbian_ua_guiSettingItemListView.h
- */
-class Csymbian_ua_guiSettingItemListView : public CAknView
- {
-public:
- // constructors and destructor
- Csymbian_ua_guiSettingItemListView();
- static Csymbian_ua_guiSettingItemListView* NewL();
- static Csymbian_ua_guiSettingItemListView* NewLC();
- void ConstructL();
- virtual ~Csymbian_ua_guiSettingItemListView();
-
-public:
- // from base class CAknView
- TUid Id() const;
- void HandleCommandL( TInt aCommand );
-
-protected:
- // from base class CAknView
- void DoActivateL(
- const TVwsViewId& aPrevViewId,
- TUid aCustomMessageId,
- const TDesC8& aCustomMessage );
- void DoDeactivate();
- void HandleStatusPaneSizeChange();
-
-private:
- void SetupStatusPaneL();
- void CleanupStatusPane();
- // [[[ begin generated region: do not modify [Generated Methods]
-public:
- // ]]] end generated region [Generated Methods]
-
-
- // [[[ begin [Overridden Methods]
-protected:
- // ]]] end [Overridden Methods]
-
-
- // [[[ begin [User Handlers]
-protected:
- TBool HandleChangeSelectedSettingItemL( TInt aCommand );
- TBool HandleControlPaneRightSoftKeyPressedL( TInt aCommand );
- TBool HandleCancelMenuItemSelectedL( TInt aCommand );
- // ]]] end [User Handlers]
-
- // [[[ begin generated region: do not modify [Generated Instance Variables]
-private:
- CSymbian_ua_guiSettingItemList* iSymbian_ua_guiSettingItemList;
- TSymbian_ua_guiSettingItemListSettings* iSettings;
- // ]]] end generated region [Generated Instance Variables]
-
- };
-
-#endif // SYMBIAN_UA_GUISETTINGITEMLISTVIEW_H
+/* +======================================================================== + Name : symbian_ua_guiSettingItemListView.h + Author : nanang + Copyright : (c) PJSIP 2008 + Description : +======================================================================== +*/ +#ifndef SYMBIAN_UA_GUISETTINGITEMLISTVIEW_H +#define SYMBIAN_UA_GUISETTINGITEMLISTVIEW_H + +// [[[ begin generated region: do not modify [Generated Includes] +#include <aknview.h> +#include "Symbian_ua_guiSettingItemListSettings.h" +// ]]] end generated region [Generated Includes] + + +// [[[ begin [Event Handler Includes] +// ]]] end [Event Handler Includes] + +// [[[ begin generated region: do not modify [Generated Forward Declarations] +class CSymbian_ua_guiSettingItemList; +// ]]] end generated region [Generated Forward Declarations] + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +/** + * Avkon view class for symbian_ua_guiSettingItemListView. It is register with the view server + * by the AppUi. It owns the container control. + * @class Csymbian_ua_guiSettingItemListView symbian_ua_guiSettingItemListView.h + */ +class Csymbian_ua_guiSettingItemListView : public CAknView + { +public: + // constructors and destructor + Csymbian_ua_guiSettingItemListView(); + static Csymbian_ua_guiSettingItemListView* NewL(); + static Csymbian_ua_guiSettingItemListView* NewLC(); + void ConstructL(); + virtual ~Csymbian_ua_guiSettingItemListView(); + +public: + // from base class CAknView + TUid Id() const; + void HandleCommandL( TInt aCommand ); + +protected: + // from base class CAknView + void DoActivateL( + const TVwsViewId& aPrevViewId, + TUid aCustomMessageId, + const TDesC8& aCustomMessage ); + void DoDeactivate(); + void HandleStatusPaneSizeChange(); + +private: + void SetupStatusPaneL(); + void CleanupStatusPane(); + // [[[ begin generated region: do not modify [Generated Methods] +public: + // ]]] end generated region [Generated Methods] + + + // [[[ begin [Overridden Methods] +protected: + // ]]] end [Overridden Methods] + + + // [[[ begin [User Handlers] +protected: + TBool HandleChangeSelectedSettingItemL( TInt aCommand ); + TBool HandleControlPaneRightSoftKeyPressedL( TInt aCommand ); + TBool HandleCancelMenuItemSelectedL( TInt aCommand ); + // ]]] end [User Handlers] + + // [[[ begin generated region: do not modify [Generated Instance Variables] +private: + CSymbian_ua_guiSettingItemList* iSymbian_ua_guiSettingItemList; + TSymbian_ua_guiSettingItemListSettings* iSettings; + // ]]] end generated region [Generated Instance Variables] + + }; + +#endif // SYMBIAN_UA_GUISETTINGITEMLISTVIEW_H diff --git a/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp b/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp index 6d752293..69be61ff 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/Symbian_ua_guiSettingItemListSets.cpp @@ -1,144 +1,144 @@ -/*
-========================================================================
- Name : Symbian_ua_guiSettingItemListSettings.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-/**
- * Generated helper class which manages the settings contained
- * in 'symbian_ua_guiSettingItemList'. Each CAknSettingItem maintains
- * a reference to data in this class so that changes in the setting
- * item list can be synchronized with this storage.
- */
-
-// [[[ begin generated region: do not modify [Generated Includes]
-#include <e32base.h>
-#include <stringloader.h>
-#include <barsread.h>
-#include <symbian_ua_gui.rsg>
-#include "Symbian_ua_guiSettingItemListSettings.h"
-// ]]] end generated region [Generated Includes]
-
-/**
- * C/C++ constructor for settings data, cannot throw
- */
-TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings()
- {
- }
-
-/**
- * Two-phase constructor for settings data
- */
-TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL()
- {
- TSymbian_ua_guiSettingItemListSettings* data = new( ELeave ) TSymbian_ua_guiSettingItemListSettings;
- CleanupStack::PushL( data );
- data->ConstructL();
- CleanupStack::Pop( data );
- return data;
- }
-
-/**
- * Second phase for initializing settings data
- */
-void TSymbian_ua_guiSettingItemListSettings::ConstructL()
- {
- // [[[ begin generated region: do not modify [Generated Initializers]
- {
- HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR );
- SetEd_registrar( text->Des() );
- CleanupStack::PopAndDestroy( text );
- }
- {
- HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER );
- SetEd_user( text->Des() );
- CleanupStack::PopAndDestroy( text );
- }
- SetB_srtp( 0 );
- SetB_ice( 0 );
- {
- HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER );
- SetEd_stun_server( text->Des() );
- CleanupStack::PopAndDestroy( text );
- }
- // ]]] end generated region [Generated Initializers]
-
- }
-
-// [[[ begin generated region: do not modify [Generated Contents]
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar()
- {
- return iEd_registrar;
- }
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar(const TDesC& aValue)
- {
- if ( aValue.Length() < KEd_registrarMaxLength)
- iEd_registrar.Copy( aValue );
- else
- iEd_registrar.Copy( aValue.Ptr(), KEd_registrarMaxLength);
- }
-
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user()
- {
- return iEd_user;
- }
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_user(const TDesC& aValue)
- {
- if ( aValue.Length() < KEd_userMaxLength)
- iEd_user.Copy( aValue );
- else
- iEd_user.Copy( aValue.Ptr(), KEd_userMaxLength);
- }
-
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password()
- {
- return iEd_password;
- }
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_password(const TDesC& aValue)
- {
- if ( aValue.Length() < KEd_passwordMaxLength)
- iEd_password.Copy( aValue );
- else
- iEd_password.Copy( aValue.Ptr(), KEd_passwordMaxLength);
- }
-
-TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp()
- {
- return iB_srtp;
- }
-
-void TSymbian_ua_guiSettingItemListSettings::SetB_srtp(const TBool& aValue)
- {
- iB_srtp = aValue;
- }
-
-TBool& TSymbian_ua_guiSettingItemListSettings::B_ice()
- {
- return iB_ice;
- }
-
-void TSymbian_ua_guiSettingItemListSettings::SetB_ice(const TBool& aValue)
- {
- iB_ice = aValue;
- }
-
-TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server()
- {
- return iEd_stun_server;
- }
-
-void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server(const TDesC& aValue)
- {
- if ( aValue.Length() < KEd_stun_serverMaxLength)
- iEd_stun_server.Copy( aValue );
- else
- iEd_stun_server.Copy( aValue.Ptr(), KEd_stun_serverMaxLength);
- }
-
-// ]]] end generated region [Generated Contents]
-
+/* +======================================================================== + Name : Symbian_ua_guiSettingItemListSettings.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +/** + * Generated helper class which manages the settings contained + * in 'symbian_ua_guiSettingItemList'. Each CAknSettingItem maintains + * a reference to data in this class so that changes in the setting + * item list can be synchronized with this storage. + */ + +// [[[ begin generated region: do not modify [Generated Includes] +#include <e32base.h> +#include <stringloader.h> +#include <barsread.h> +#include <symbian_ua_gui.rsg> +#include "Symbian_ua_guiSettingItemListSettings.h" +// ]]] end generated region [Generated Includes] + +/** + * C/C++ constructor for settings data, cannot throw + */ +TSymbian_ua_guiSettingItemListSettings::TSymbian_ua_guiSettingItemListSettings() + { + } + +/** + * Two-phase constructor for settings data + */ +TSymbian_ua_guiSettingItemListSettings* TSymbian_ua_guiSettingItemListSettings::NewL() + { + TSymbian_ua_guiSettingItemListSettings* data = new( ELeave ) TSymbian_ua_guiSettingItemListSettings; + CleanupStack::PushL( data ); + data->ConstructL(); + CleanupStack::Pop( data ); + return data; + } + +/** + * Second phase for initializing settings data + */ +void TSymbian_ua_guiSettingItemListSettings::ConstructL() + { + // [[[ begin generated region: do not modify [Generated Initializers] + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_REGISTRAR ); + SetEd_registrar( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_USER ); + SetEd_user( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + SetB_srtp( 0 ); + SetB_ice( 0 ); + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_ED_STUN_SERVER ); + SetEd_stun_server( text->Des() ); + CleanupStack::PopAndDestroy( text ); + } + // ]]] end generated region [Generated Initializers] + + } + +// [[[ begin generated region: do not modify [Generated Contents] +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_registrar() + { + return iEd_registrar; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_registrar(const TDesC& aValue) + { + if ( aValue.Length() < KEd_registrarMaxLength) + iEd_registrar.Copy( aValue ); + else + iEd_registrar.Copy( aValue.Ptr(), KEd_registrarMaxLength); + } + +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_user() + { + return iEd_user; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_user(const TDesC& aValue) + { + if ( aValue.Length() < KEd_userMaxLength) + iEd_user.Copy( aValue ); + else + iEd_user.Copy( aValue.Ptr(), KEd_userMaxLength); + } + +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_password() + { + return iEd_password; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_password(const TDesC& aValue) + { + if ( aValue.Length() < KEd_passwordMaxLength) + iEd_password.Copy( aValue ); + else + iEd_password.Copy( aValue.Ptr(), KEd_passwordMaxLength); + } + +TBool& TSymbian_ua_guiSettingItemListSettings::B_srtp() + { + return iB_srtp; + } + +void TSymbian_ua_guiSettingItemListSettings::SetB_srtp(const TBool& aValue) + { + iB_srtp = aValue; + } + +TBool& TSymbian_ua_guiSettingItemListSettings::B_ice() + { + return iB_ice; + } + +void TSymbian_ua_guiSettingItemListSettings::SetB_ice(const TBool& aValue) + { + iB_ice = aValue; + } + +TDes& TSymbian_ua_guiSettingItemListSettings::Ed_stun_server() + { + return iEd_stun_server; + } + +void TSymbian_ua_guiSettingItemListSettings::SetEd_stun_server(const TDesC& aValue) + { + if ( aValue.Length() < KEd_stun_serverMaxLength) + iEd_stun_server.Copy( aValue ); + else + iEd_stun_server.Copy( aValue.Ptr(), KEd_stun_serverMaxLength); + } + +// ]]] end generated region [Generated Contents] + diff --git a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp index ac399510..6022f23e 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiAppUi.cpp @@ -1,247 +1,247 @@ -/*
-========================================================================
- Name : symbian_ua_guiAppUi.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <eikmenub.h>
-#include <akncontext.h>
-#include <akntitle.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_guiAppUi.h"
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_guiContainerView.h"
-#include "symbian_ua_guiSettingItemListView.h"
-// ]]] end generated region [Generated User Includes]
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-#include "symbian_ua.h"
-
-/**
- * Construct the Csymbian_ua_guiAppUi instance
- */
-Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0)
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- * The appui's destructor removes the container from the control
- * stack and destroys it.
- */
-Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() );
- // ]]] end generated region [Generated Contents]
- }
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiAppUi::InitializeContainersL()
- {
- iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL();
- AddViewL( iSymbian_ua_guiContainerView );
- iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL();
- AddViewL( iSymbian_ua_guiSettingItemListView );
- SetDefaultViewL( *iSymbian_ua_guiSettingItemListView );
- }
-// ]]] end generated function
-
-/**
- * Handle a command for this appui (override)
- * @param aCommand command id to be handled
- */
-void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand )
- {
- // [[[ begin generated region: do not modify [Generated Code]
- TBool commandHandled = EFalse;
- switch ( aCommand )
- { // code to dispatch to the AppUi's menu and CBA commands is generated here
- default:
- break;
- }
-
-
- if ( !commandHandled )
- {
- if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit )
- {
- symbian_ua_destroy();
- Exit();
- }
- }
- // ]]] end generated region [Generated Code]
-
- }
-
-/**
- * Override of the HandleResourceChangeL virtual function
- */
-void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType )
- {
- CAknViewAppUi::HandleResourceChangeL( aType );
- // [[[ begin generated region: do not modify [Generated Code]
- // ]]] end generated region [Generated Code]
-
- }
-
-/**
- * Override of the HandleKeyEventL virtual function
- * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not
- * @param aKeyEvent
- * @param aType
- */
-TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL(
- const TKeyEvent& aKeyEvent,
- TEventCode aType )
- {
- // The inherited HandleKeyEventL is private and cannot be called
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- return EKeyWasNotConsumed;
- }
-
-/**
- * Override of the HandleViewDeactivation virtual function
- *
- * @param aViewIdToBeDeactivated
- * @param aNewlyActivatedViewId
- */
-void Csymbian_ua_guiAppUi::HandleViewDeactivation(
- const TVwsViewId& aViewIdToBeDeactivated,
- const TVwsViewId& aNewlyActivatedViewId )
- {
- CAknViewAppUi::HandleViewDeactivation(
- aViewIdToBeDeactivated,
- aNewlyActivatedViewId );
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- * @brief Completes the second phase of Symbian object construction.
- * Put initialization code that could leave here.
- */
-void Csymbian_ua_guiAppUi::ConstructL()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- BaseConstructL( EAknEnableSkin );
- InitializeContainersL();
- // ]]] end generated region [Generated Contents]
-
- // Create private folder
- RProcess process;
- TFileName path;
-
- path.Copy( process.FileName().Left(2) );
-
- if(path.Compare(_L("c")) || path.Compare(_L("C")))
- CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC);
- else if(path.Compare(_L("e")) || path.Compare(_L("E")))
- CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE);
-
- // Init PJSUA
- if (symbian_ua_init() != 0) {
- symbian_ua_destroy();
- Exit();
- }
-
- ExecuteDlg_wait_initLD();
-
- CTimer::ConstructL();
- CActiveScheduler::Add( this );
- After(4000000);
- }
-
-/**
- * Override of the HandleApplicationSpecificEventL virtual function
- */
-void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL(
- TInt aType,
- const TWsEvent& anEvent )
- {
- CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent );
- // [[[ begin generated region: do not modify [Generated Code]
- // ]]] end generated region [Generated Code]
-
- }
-
-/**
- * Handle the applicationSpecificEvent event.
- */
-void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL(
- TInt /* aType */,
- const TWsEvent& /* anEvent */ )
- {
- // TODO: implement applicationSpecificEvent event handler
- }
-
-// [[[ begin generated function: do not modify
-/**
- * Execute the wait dialog for dlg_wait_init. This routine returns
- * while the dialog is showing. It will be closed and destroyed when
- * RemoveDlg_wait_initL() or the user selects the Cancel soft key.
- * @param aOverrideText optional override text. When null the text configured
- * in the UI Designer is used.
- */
-void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText )
- {
- iDlg_wait_init = new ( ELeave ) CAknWaitDialog(
- reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse );
- if ( aOverrideText != NULL )
- {
- iDlg_wait_init->SetTextL( *aOverrideText );
- }
- iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT );
- iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback(
- this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL );
- iDlg_wait_init->SetCallback( iDlg_wait_initCallback );
- }
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Close and dispose of the wait dialog for dlg_wait_init
- */
-void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL()
- {
- if ( iDlg_wait_init != NULL )
- {
- iDlg_wait_init->SetCallback( NULL );
- iDlg_wait_init->ProcessFinishedL(); // deletes the dialog
- iDlg_wait_init = NULL;
- }
- delete iDlg_wait_initCallback;
- iDlg_wait_initCallback = NULL;
-
- }
-// ]]] end generated function
-
-/**
- * Handle the canceled event.
- */
-void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ )
- {
- // TODO: implement canceled event handler
-
- }
-
-void Csymbian_ua_guiAppUi::RunL()
- {
- RemoveDlg_wait_initL();
- iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave);
- }
+/* +======================================================================== + Name : symbian_ua_guiAppUi.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <eikmenub.h> +#include <akncontext.h> +#include <akntitle.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_guiAppUi.h" +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_guiContainerView.h" +#include "symbian_ua_guiSettingItemListView.h" +// ]]] end generated region [Generated User Includes] + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +#include "symbian_ua.h" + +/** + * Construct the Csymbian_ua_guiAppUi instance + */ +Csymbian_ua_guiAppUi::Csymbian_ua_guiAppUi() : CTimer(0) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** + * The appui's destructor removes the container from the control + * stack and destroys it. + */ +Csymbian_ua_guiAppUi::~Csymbian_ua_guiAppUi() + { + // [[[ begin generated region: do not modify [Generated Contents] + TRAPD( err_Dlg_wait_init, RemoveDlg_wait_initL() ); + // ]]] end generated region [Generated Contents] + } + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiAppUi::InitializeContainersL() + { + iSymbian_ua_guiContainerView = Csymbian_ua_guiContainerView::NewL(); + AddViewL( iSymbian_ua_guiContainerView ); + iSymbian_ua_guiSettingItemListView = Csymbian_ua_guiSettingItemListView::NewL(); + AddViewL( iSymbian_ua_guiSettingItemListView ); + SetDefaultViewL( *iSymbian_ua_guiSettingItemListView ); + } +// ]]] end generated function + +/** + * Handle a command for this appui (override) + * @param aCommand command id to be handled + */ +void Csymbian_ua_guiAppUi::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AppUi's menu and CBA commands is generated here + default: + break; + } + + + if ( !commandHandled ) + { + if ( aCommand == EAknSoftkeyExit || aCommand == EEikCmdExit ) + { + symbian_ua_destroy(); + Exit(); + } + } + // ]]] end generated region [Generated Code] + + } + +/** + * Override of the HandleResourceChangeL virtual function + */ +void Csymbian_ua_guiAppUi::HandleResourceChangeL( TInt aType ) + { + CAknViewAppUi::HandleResourceChangeL( aType ); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + + } + +/** + * Override of the HandleKeyEventL virtual function + * @return EKeyWasConsumed if event was handled, EKeyWasNotConsumed if not + * @param aKeyEvent + * @param aType + */ +TKeyResponse Csymbian_ua_guiAppUi::HandleKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // The inherited HandleKeyEventL is private and cannot be called + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + return EKeyWasNotConsumed; + } + +/** + * Override of the HandleViewDeactivation virtual function + * + * @param aViewIdToBeDeactivated + * @param aNewlyActivatedViewId + */ +void Csymbian_ua_guiAppUi::HandleViewDeactivation( + const TVwsViewId& aViewIdToBeDeactivated, + const TVwsViewId& aNewlyActivatedViewId ) + { + CAknViewAppUi::HandleViewDeactivation( + aViewIdToBeDeactivated, + aNewlyActivatedViewId ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ +void Csymbian_ua_guiAppUi::ConstructL() + { + // [[[ begin generated region: do not modify [Generated Contents] + BaseConstructL( EAknEnableSkin ); + InitializeContainersL(); + // ]]] end generated region [Generated Contents] + + // Create private folder + RProcess process; + TFileName path; + + path.Copy( process.FileName().Left(2) ); + + if(path.Compare(_L("c")) || path.Compare(_L("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); + else if(path.Compare(_L("e")) || path.Compare(_L("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); + + // Init PJSUA + if (symbian_ua_init() != 0) { + symbian_ua_destroy(); + Exit(); + } + + ExecuteDlg_wait_initLD(); + + CTimer::ConstructL(); + CActiveScheduler::Add( this ); + After(4000000); + } + +/** + * Override of the HandleApplicationSpecificEventL virtual function + */ +void Csymbian_ua_guiAppUi::HandleApplicationSpecificEventL( + TInt aType, + const TWsEvent& anEvent ) + { + CAknViewAppUi::HandleApplicationSpecificEventL( aType, anEvent ); + // [[[ begin generated region: do not modify [Generated Code] + // ]]] end generated region [Generated Code] + + } + +/** + * Handle the applicationSpecificEvent event. + */ +void Csymbian_ua_guiAppUi::HandleSymbian_ua_guiAppUiApplicationSpecificEventL( + TInt /* aType */, + const TWsEvent& /* anEvent */ ) + { + // TODO: implement applicationSpecificEvent event handler + } + +// [[[ begin generated function: do not modify +/** + * Execute the wait dialog for dlg_wait_init. This routine returns + * while the dialog is showing. It will be closed and destroyed when + * RemoveDlg_wait_initL() or the user selects the Cancel soft key. + * @param aOverrideText optional override text. When null the text configured + * in the UI Designer is used. + */ +void Csymbian_ua_guiAppUi::ExecuteDlg_wait_initLD( const TDesC* aOverrideText ) + { + iDlg_wait_init = new ( ELeave ) CAknWaitDialog( + reinterpret_cast< CEikDialog** >( &iDlg_wait_init ), EFalse ); + if ( aOverrideText != NULL ) + { + iDlg_wait_init->SetTextL( *aOverrideText ); + } + iDlg_wait_init->ExecuteLD( R_APPLICATION_DLG_WAIT_INIT ); + iDlg_wait_initCallback = new ( ELeave ) CProgressDialogCallback( + this, iDlg_wait_init, &Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL ); + iDlg_wait_init->SetCallback( iDlg_wait_initCallback ); + } +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Close and dispose of the wait dialog for dlg_wait_init + */ +void Csymbian_ua_guiAppUi::RemoveDlg_wait_initL() + { + if ( iDlg_wait_init != NULL ) + { + iDlg_wait_init->SetCallback( NULL ); + iDlg_wait_init->ProcessFinishedL(); // deletes the dialog + iDlg_wait_init = NULL; + } + delete iDlg_wait_initCallback; + iDlg_wait_initCallback = NULL; + + } +// ]]] end generated function + +/** + * Handle the canceled event. + */ +void Csymbian_ua_guiAppUi::HandleDlg_wait_initCanceledL( CAknProgressDialog* /* aDialog */ ) + { + // TODO: implement canceled event handler + + } + +void Csymbian_ua_guiAppUi::RunL() + { + RemoveDlg_wait_initL(); + iSymbian_ua_guiSettingItemListView->HandleCommandL(EAknSoftkeySave); + } diff --git a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp index dc60fecd..1396d84e 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiApplication.cpp @@ -1,86 +1,86 @@ -/*
-========================================================================
- Name : symbian_ua_guiApplication.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated Includes]
-#include "symbian_ua_guiApplication.h"
-#include "symbian_ua_guiDocument.h"
-#ifdef EKA2
-#include <eikstart.h>
-#endif
-// ]]] end generated region [Generated Includes]
-
-
-// Needed by APS
-TPtrC APP_UID = _L("EBD12EE4");
-
-/**
- * @brief Returns the application's UID (override from CApaApplication::AppDllUid())
- * @return UID for this application (KUidsymbian_ua_guiApplication)
- */
-TUid Csymbian_ua_guiApplication::AppDllUid() const
- {
- return KUidsymbian_ua_guiApplication;
- }
-
-/**
- * @brief Creates the application's document (override from CApaApplication::CreateDocumentL())
- * @return Pointer to the created document object (Csymbian_ua_guiDocument)
- */
-CApaDocument* Csymbian_ua_guiApplication::CreateDocumentL()
- {
- return Csymbian_ua_guiDocument::NewL( *this );
- }
-
-#ifdef EKA2
-
-/**
- * @brief Called by the application framework to construct the application object
- * @return The application (Csymbian_ua_guiApplication)
- */
-LOCAL_C CApaApplication* NewApplication()
- {
- return new Csymbian_ua_guiApplication;
- }
-
-/**
-* @brief This standard export is the entry point for all Series 60 applications
-* @return error code
- */
-GLDEF_C TInt E32Main()
- {
- TInt err;
-
- err = EikStart::RunApplication( NewApplication );
-
- return err;
- }
-
-#else // Series 60 2.x main DLL program code
-
-/**
-* @brief This standard export constructs the application object.
-* @return The application (Csymbian_ua_guiApplication)
-*/
-EXPORT_C CApaApplication* NewApplication()
- {
- return new Csymbian_ua_guiApplication;
- }
-
-/**
-* @brief This standard export is the entry point for all Series 60 applications
-* @return error code
-*/
-GLDEF_C TInt E32Dll(TDllReason /*reason*/)
- {
- return KErrNone;
- }
-
-#endif // EKA2
+/* +======================================================================== + Name : symbian_ua_guiApplication.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated Includes] +#include "symbian_ua_guiApplication.h" +#include "symbian_ua_guiDocument.h" +#ifdef EKA2 +#include <eikstart.h> +#endif +// ]]] end generated region [Generated Includes] + + +// Needed by APS +TPtrC APP_UID = _L("EBD12EE4"); + +/** + * @brief Returns the application's UID (override from CApaApplication::AppDllUid()) + * @return UID for this application (KUidsymbian_ua_guiApplication) + */ +TUid Csymbian_ua_guiApplication::AppDllUid() const + { + return KUidsymbian_ua_guiApplication; + } + +/** + * @brief Creates the application's document (override from CApaApplication::CreateDocumentL()) + * @return Pointer to the created document object (Csymbian_ua_guiDocument) + */ +CApaDocument* Csymbian_ua_guiApplication::CreateDocumentL() + { + return Csymbian_ua_guiDocument::NewL( *this ); + } + +#ifdef EKA2 + +/** + * @brief Called by the application framework to construct the application object + * @return The application (Csymbian_ua_guiApplication) + */ +LOCAL_C CApaApplication* NewApplication() + { + return new Csymbian_ua_guiApplication; + } + +/** +* @brief This standard export is the entry point for all Series 60 applications +* @return error code + */ +GLDEF_C TInt E32Main() + { + TInt err; + + err = EikStart::RunApplication( NewApplication ); + + return err; + } + +#else // Series 60 2.x main DLL program code + +/** +* @brief This standard export constructs the application object. +* @return The application (Csymbian_ua_guiApplication) +*/ +EXPORT_C CApaApplication* NewApplication() + { + return new Csymbian_ua_guiApplication; + } + +/** +* @brief This standard export is the entry point for all Series 60 applications +* @return error code +*/ +GLDEF_C TInt E32Dll(TDllReason /*reason*/) + { + return KErrNone; + } + +#endif // EKA2 diff --git a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp index 777217c7..1b3cd024 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainer.cpp @@ -1,285 +1,285 @@ -/*
-========================================================================
- Name : symbian_ua_guiContainer.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <barsread.h>
-#include <stringloader.h>
-#include <eiklabel.h>
-#include <eikenv.h>
-#include <gdi.h>
-#include <eikedwin.h>
-#include <aknviewappui.h>
-#include <eikappui.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_guiContainer.h"
-#include "symbian_ua_guiContainerView.h"
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-// ]]] end generated region [Generated User Includes]
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-/**
- * First phase of Symbian two-phase construction. Should not
- * contain any code that could leave.
- */
-CSymbian_ua_guiContainer::CSymbian_ua_guiContainer()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- iLabel1 = NULL;
- iEd_url = NULL;
- iEd_info = NULL;
- // ]]] end generated region [Generated Contents]
-
- }
-/**
- * Destroy child controls.
- */
-CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- delete iLabel1;
- iLabel1 = NULL;
- delete iEd_url;
- iEd_url = NULL;
- delete iEd_info;
- iEd_info = NULL;
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- * Construct the control (first phase).
- * Creates an instance and initializes it.
- * Instance is not left on cleanup stack.
- * @param aRect bounding rectangle
- * @param aParent owning parent, or NULL
- * @param aCommandObserver command observer
- * @return initialized instance of CSymbian_ua_guiContainer
- */
-CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL(
- const TRect& aRect,
- const CCoeControl* aParent,
- MEikCommandObserver* aCommandObserver )
- {
- CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC(
- aRect,
- aParent,
- aCommandObserver );
- CleanupStack::Pop( self );
- return self;
- }
-
-/**
- * Construct the control (first phase).
- * Creates an instance and initializes it.
- * Instance is left on cleanup stack.
- * @param aRect The rectangle for this window
- * @param aParent owning parent, or NULL
- * @param aCommandObserver command observer
- * @return new instance of CSymbian_ua_guiContainer
- */
-CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC(
- const TRect& aRect,
- const CCoeControl* aParent,
- MEikCommandObserver* aCommandObserver )
- {
- CSymbian_ua_guiContainer* self = new ( ELeave ) CSymbian_ua_guiContainer();
- CleanupStack::PushL( self );
- self->ConstructL( aRect, aParent, aCommandObserver );
- return self;
- }
-
-/**
- * Construct the control (second phase).
- * Creates a window to contain the controls and activates it.
- * @param aRect bounding rectangle
- * @param aCommandObserver command observer
- * @param aParent owning parent, or NULL
- */
-void CSymbian_ua_guiContainer::ConstructL(
- const TRect& aRect,
- const CCoeControl* aParent,
- MEikCommandObserver* aCommandObserver )
- {
- if ( aParent == NULL )
- {
- CreateWindowL();
- }
- else
- {
- SetContainerWindowL( *aParent );
- }
- iFocusControl = NULL;
- iCommandObserver = aCommandObserver;
- InitializeControlsL();
- SetRect( aRect );
- ActivateL();
- // [[[ begin generated region: do not modify [Post-ActivateL initializations]
- // ]]] end generated region [Post-ActivateL initializations]
-
- }
-
-/**
-* Return the number of controls in the container (override)
-* @return count
-*/
-TInt CSymbian_ua_guiContainer::CountComponentControls() const
- {
- return ( int ) ELastControl;
- }
-
-/**
-* Get the control with the given index (override)
-* @param aIndex Control index [0...n) (limited by #CountComponentControls)
-* @return Pointer to control
-*/
-CCoeControl* CSymbian_ua_guiContainer::ComponentControl( TInt aIndex ) const
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- switch ( aIndex )
- {
- case ELabel1:
- return iLabel1;
- case EEd_url:
- return iEd_url;
- case EEd_info:
- return iEd_info;
- }
- // ]]] end generated region [Generated Contents]
-
- // handle any user controls here...
-
- return NULL;
- }
-
-/**
- * Handle resizing of the container. This implementation will lay out
- * full-sized controls like list boxes for any screen size, and will layout
- * labels, editors, etc. to the size they were given in the UI designer.
- * This code will need to be modified to adjust arbitrary controls to
- * any screen size.
- */
-void CSymbian_ua_guiContainer::SizeChanged()
- {
- CCoeControl::SizeChanged();
- LayoutControls();
- // [[[ begin generated region: do not modify [Generated Contents]
-
- // ]]] end generated region [Generated Contents]
-
- }
-
-// [[[ begin generated function: do not modify
-/**
- * Layout components as specified in the UI Designer
- */
-void CSymbian_ua_guiContainer::LayoutControls()
- {
- iLabel1->SetExtent( TPoint( 2, 23 ), TSize( 32, 28 ) );
- iEd_url->SetExtent( TPoint( 49, 25 ), TSize( 197, 28 ) );
- iEd_info->SetExtent( TPoint( 3, 78 ), TSize( 235, 143 ) );
- }
-// ]]] end generated function
-
-/**
- * Handle key events.
- */
-TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL(
- const TKeyEvent& aKeyEvent,
- TEventCode aType )
- {
- // [[[ begin generated region: do not modify [Generated Contents]
-
- // ]]] end generated region [Generated Contents]
-
- if ( iFocusControl != NULL
- && iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed )
- {
- return EKeyWasConsumed;
- }
- return CCoeControl::OfferKeyEventL( aKeyEvent, aType );
- }
-
-// [[[ begin generated function: do not modify
-/**
- * Initialize each control upon creation.
- */
-void CSymbian_ua_guiContainer::InitializeControlsL()
- {
- iLabel1 = new ( ELeave ) CEikLabel;
- iLabel1->SetContainerWindowL( *this );
- {
- TResourceReader reader;
- iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1 );
- iLabel1->ConstructFromResourceL( reader );
- CleanupStack::PopAndDestroy(); // reader internal state
- }
- iEd_url = new ( ELeave ) CEikEdwin;
- iEd_url->SetContainerWindowL( *this );
- {
- TResourceReader reader;
- iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL );
- iEd_url->ConstructFromResourceL( reader );
- CleanupStack::PopAndDestroy(); // reader internal state
- }
- {
- HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2 );
- iEd_url->SetTextL( text );
- CleanupStack::PopAndDestroy( text );
- }
- iEd_info = new ( ELeave ) CEikEdwin;
- iEd_info->SetContainerWindowL( *this );
- {
- TResourceReader reader;
- iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO );
- iEd_info->ConstructFromResourceL( reader );
- CleanupStack::PopAndDestroy(); // reader internal state
- }
- {
- HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2 );
- iEd_info->SetTextL( text );
- CleanupStack::PopAndDestroy( text );
- }
-
- iEd_url->SetFocus( ETrue );
- iFocusControl = iEd_url;
-
- }
-// ]]] end generated function
-
-/**
- * Handle global resource changes, such as scalable UI or skin events (override)
- */
-void CSymbian_ua_guiContainer::HandleResourceChange( TInt aType )
- {
- CCoeControl::HandleResourceChange( aType );
- SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiContainerViewId ) )->ClientRect() );
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- * Draw container contents.
- */
-void CSymbian_ua_guiContainer::Draw( const TRect& aRect ) const
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- CWindowGc& gc = SystemGc();
- gc.Clear( aRect );
-
- // ]]] end generated region [Generated Contents]
-
- }
-
+/* +======================================================================== + Name : symbian_ua_guiContainer.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <barsread.h> +#include <stringloader.h> +#include <eiklabel.h> +#include <eikenv.h> +#include <gdi.h> +#include <eikedwin.h> +#include <aknviewappui.h> +#include <eikappui.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_guiContainer.h" +#include "symbian_ua_guiContainerView.h" +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +// ]]] end generated region [Generated User Includes] + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +/** + * First phase of Symbian two-phase construction. Should not + * contain any code that could leave. + */ +CSymbian_ua_guiContainer::CSymbian_ua_guiContainer() + { + // [[[ begin generated region: do not modify [Generated Contents] + iLabel1 = NULL; + iEd_url = NULL; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + + } +/** + * Destroy child controls. + */ +CSymbian_ua_guiContainer::~CSymbian_ua_guiContainer() + { + // [[[ begin generated region: do not modify [Generated Contents] + delete iLabel1; + iLabel1 = NULL; + delete iEd_url; + iEd_url = NULL; + delete iEd_info; + iEd_info = NULL; + // ]]] end generated region [Generated Contents] + + } + +/** + * Construct the control (first phase). + * Creates an instance and initializes it. + * Instance is not left on cleanup stack. + * @param aRect bounding rectangle + * @param aParent owning parent, or NULL + * @param aCommandObserver command observer + * @return initialized instance of CSymbian_ua_guiContainer + */ +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + CSymbian_ua_guiContainer* self = CSymbian_ua_guiContainer::NewLC( + aRect, + aParent, + aCommandObserver ); + CleanupStack::Pop( self ); + return self; + } + +/** + * Construct the control (first phase). + * Creates an instance and initializes it. + * Instance is left on cleanup stack. + * @param aRect The rectangle for this window + * @param aParent owning parent, or NULL + * @param aCommandObserver command observer + * @return new instance of CSymbian_ua_guiContainer + */ +CSymbian_ua_guiContainer* CSymbian_ua_guiContainer::NewLC( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + CSymbian_ua_guiContainer* self = new ( ELeave ) CSymbian_ua_guiContainer(); + CleanupStack::PushL( self ); + self->ConstructL( aRect, aParent, aCommandObserver ); + return self; + } + +/** + * Construct the control (second phase). + * Creates a window to contain the controls and activates it. + * @param aRect bounding rectangle + * @param aCommandObserver command observer + * @param aParent owning parent, or NULL + */ +void CSymbian_ua_guiContainer::ConstructL( + const TRect& aRect, + const CCoeControl* aParent, + MEikCommandObserver* aCommandObserver ) + { + if ( aParent == NULL ) + { + CreateWindowL(); + } + else + { + SetContainerWindowL( *aParent ); + } + iFocusControl = NULL; + iCommandObserver = aCommandObserver; + InitializeControlsL(); + SetRect( aRect ); + ActivateL(); + // [[[ begin generated region: do not modify [Post-ActivateL initializations] + // ]]] end generated region [Post-ActivateL initializations] + + } + +/** +* Return the number of controls in the container (override) +* @return count +*/ +TInt CSymbian_ua_guiContainer::CountComponentControls() const + { + return ( int ) ELastControl; + } + +/** +* Get the control with the given index (override) +* @param aIndex Control index [0...n) (limited by #CountComponentControls) +* @return Pointer to control +*/ +CCoeControl* CSymbian_ua_guiContainer::ComponentControl( TInt aIndex ) const + { + // [[[ begin generated region: do not modify [Generated Contents] + switch ( aIndex ) + { + case ELabel1: + return iLabel1; + case EEd_url: + return iEd_url; + case EEd_info: + return iEd_info; + } + // ]]] end generated region [Generated Contents] + + // handle any user controls here... + + return NULL; + } + +/** + * Handle resizing of the container. This implementation will lay out + * full-sized controls like list boxes for any screen size, and will layout + * labels, editors, etc. to the size they were given in the UI designer. + * This code will need to be modified to adjust arbitrary controls to + * any screen size. + */ +void CSymbian_ua_guiContainer::SizeChanged() + { + CCoeControl::SizeChanged(); + LayoutControls(); + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + + } + +// [[[ begin generated function: do not modify +/** + * Layout components as specified in the UI Designer + */ +void CSymbian_ua_guiContainer::LayoutControls() + { + iLabel1->SetExtent( TPoint( 2, 23 ), TSize( 32, 28 ) ); + iEd_url->SetExtent( TPoint( 49, 25 ), TSize( 197, 28 ) ); + iEd_info->SetExtent( TPoint( 3, 78 ), TSize( 235, 143 ) ); + } +// ]]] end generated function + +/** + * Handle key events. + */ +TKeyResponse CSymbian_ua_guiContainer::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // [[[ begin generated region: do not modify [Generated Contents] + + // ]]] end generated region [Generated Contents] + + if ( iFocusControl != NULL + && iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) + { + return EKeyWasConsumed; + } + return CCoeControl::OfferKeyEventL( aKeyEvent, aType ); + } + +// [[[ begin generated function: do not modify +/** + * Initialize each control upon creation. + */ +void CSymbian_ua_guiContainer::InitializeControlsL() + { + iLabel1 = new ( ELeave ) CEikLabel; + iLabel1->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_LABEL1 ); + iLabel1->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + iEd_url = new ( ELeave ) CEikEdwin; + iEd_url->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_URL ); + iEd_url->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_URL_2 ); + iEd_url->SetTextL( text ); + CleanupStack::PopAndDestroy( text ); + } + iEd_info = new ( ELeave ) CEikEdwin; + iEd_info->SetContainerWindowL( *this ); + { + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO ); + iEd_info->ConstructFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + { + HBufC* text = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_ED_INFO_2 ); + iEd_info->SetTextL( text ); + CleanupStack::PopAndDestroy( text ); + } + + iEd_url->SetFocus( ETrue ); + iFocusControl = iEd_url; + + } +// ]]] end generated function + +/** + * Handle global resource changes, such as scalable UI or skin events (override) + */ +void CSymbian_ua_guiContainer::HandleResourceChange( TInt aType ) + { + CCoeControl::HandleResourceChange( aType ); + SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiContainerViewId ) )->ClientRect() ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** + * Draw container contents. + */ +void CSymbian_ua_guiContainer::Draw( const TRect& aRect ) const + { + // [[[ begin generated region: do not modify [Generated Contents] + CWindowGc& gc = SystemGc(); + gc.Clear( aRect ); + + // ]]] end generated region [Generated Contents] + + } + diff --git a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp index 661c210e..b0d7d4fb 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiContainerView.cpp @@ -1,478 +1,478 @@ -/*
-========================================================================
- Name : symbian_ua_guiContainerView.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <aknviewappui.h>
-#include <eikmenub.h>
-#include <avkon.hrh>
-#include <barsread.h>
-#include <stringloader.h>
-#include <eiklabel.h>
-#include <eikenv.h>
-#include <gdi.h>
-#include <eikedwin.h>
-#include <akncontext.h>
-#include <akntitle.h>
-#include <eikbtgpc.h>
-#include <aknnotewrappers.h>
-#include <aknquerydialog.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiContainerView.h"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_guiContainer.h"
-// ]]] end generated region [Generated User Includes]
-
-#include <utf.h>
-#include "symbian_ua.h"
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-Csymbian_ua_guiContainerView *myinstance = NULL;
-_LIT(KStCall, "Call");
-_LIT(KStHangUp, "Hang Up");
-
-void on_info(const wchar_t* buf)
-{
- TPtrC aBuf((const TUint16*)buf);
-
- if (myinstance)
- myinstance->PutMessage(aBuf);
-}
-
-void on_incoming_call(const wchar_t* caller_disp, const wchar_t* caller_uri)
-{
- TBuf<512> buf;
- TPtrC aDisp((const TUint16*)caller_disp);
- TPtrC aUri((const TUint16*)caller_uri);
- _LIT(KFormat, "Incoming call from %S, accept?");
-
- buf.Format(KFormat, &aDisp);
- if (Csymbian_ua_guiContainerView::RunQry_accept_callL(&buf) == EAknSoftkeyYes)
- {
- CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
- if (cba != NULL) {
- TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp));
- cba->DrawDeferred();
- }
- symbian_ua_answercall();
- } else {
- symbian_ua_endcall();
- }
-}
-
-void on_call_end(const wchar_t* reason)
-{
- TPtrC aReason((const TUint16*)reason);
-
- CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
- if (cba != NULL) {
- TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall));
- cba->DrawDeferred();
- }
-
- Csymbian_ua_guiContainerView::RunNote_infoL(&aReason);
-}
-
-void on_reg_state(bool success)
-{
- if (success)
- Csymbian_ua_guiContainerView::RunNote_infoL();
- else
- Csymbian_ua_guiContainerView::RunNote_warningL();
-}
-
-void on_unreg_state(bool success)
-{
- TPtrC st_success(_L("Unregistration Success!"));
- TPtrC st_failed(_L("Unregistration Failed!"));
-
- if (success)
- Csymbian_ua_guiContainerView::RunNote_infoL(&st_success);
- else
- Csymbian_ua_guiContainerView::RunNote_warningL(&st_failed);
-}
-
-void Csymbian_ua_guiContainerView::PutMessage(const TDesC &msg)
- {
- if (!iSymbian_ua_guiContainer)
- return;
-
- CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_info);
-
- obj_info->SetTextL(&msg);
- obj_info->DrawDeferred();
- }
-
-/**
- * First phase of Symbian two-phase construction. Should not contain any
- * code that could leave.
- */
-Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- iSymbian_ua_guiContainer = NULL;
- // ]]] end generated region [Generated Contents]
-
- }
-/**
- * The view's destructor removes the container from the control
- * stack and destroys it.
- */
-Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- delete iSymbian_ua_guiContainer;
- iSymbian_ua_guiContainer = NULL;
- // ]]] end generated region [Generated Contents]
-
- symbian_ua_set_info_callback(NULL);
- myinstance = NULL;
- }
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance then calls the second-phase constructor
- * without leaving the instance on the cleanup stack.
- * @return new instance of Csymbian_ua_guiContainerView
- */
-Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL()
- {
- Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance, pushes it on the cleanup stack,
- * then calls the second-phase constructor.
- * @return new instance of Csymbian_ua_guiContainerView
- */
-Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC()
- {
- Csymbian_ua_guiContainerView* self = new ( ELeave ) Csymbian_ua_guiContainerView();
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-
-/**
- * Second-phase constructor for view.
- * Initialize contents from resource.
- */
-void Csymbian_ua_guiContainerView::ConstructL()
- {
- // [[[ begin generated region: do not modify [Generated Code]
- BaseConstructL( R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW );
- // ]]] end generated region [Generated Code]
-
- // add your own initialization code here
- symbian_ua_info_cb_t cb;
- Mem::FillZ(&cb, sizeof(cb));
-
- cb.on_info = &on_info;
- cb.on_incoming_call = &on_incoming_call;
- cb.on_reg_state = &on_reg_state;
- cb.on_unreg_state = &on_unreg_state;
- cb.on_call_end = &on_call_end;
-
- symbian_ua_set_info_callback(&cb);
- myinstance = this;
- }
-
-/**
- * @return The UID for this view
- */
-TUid Csymbian_ua_guiContainerView::Id() const
- {
- return TUid::Uid( ESymbian_ua_guiContainerViewId );
- }
-
-/**
- * Handle a command for this view (override)
- * @param aCommand command id to be handled
- */
-void Csymbian_ua_guiContainerView::HandleCommandL( TInt aCommand )
- {
- // [[[ begin generated region: do not modify [Generated Code]
- TBool commandHandled = EFalse;
- switch ( aCommand )
- { // code to dispatch to the AknView's menu and CBA commands is generated here
-
- case ESymbian_ua_guiContainerViewControlPaneRightId:
- commandHandled = CallSoftKeyPressedL( aCommand );
- break;
- case ESymbian_ua_guiContainerViewSettingMenuItemCommand:
- commandHandled = HandleSettingMenuItemSelectedL( aCommand );
- break;
- default:
- break;
- }
-
-
- if ( !commandHandled )
- {
-
- if ( aCommand == ESymbian_ua_guiContainerViewControlPaneRightId )
- {
- AppUi()->HandleCommandL( EEikCmdExit );
- }
-
- }
- // ]]] end generated region [Generated Code]
-
- }
-
-/**
- * Handles user actions during activation of the view,
- * such as initializing the content.
- */
-void Csymbian_ua_guiContainerView::DoActivateL(
- const TVwsViewId& /*aPrevViewId*/,
- TUid /*aCustomMessageId*/,
- const TDesC8& /*aCustomMessage*/ )
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- SetupStatusPaneL();
-
- CEikButtonGroupContainer* cba = AppUi()->Cba();
- if ( cba != NULL )
- {
- cba->MakeVisible( EFalse );
- }
-
- if ( iSymbian_ua_guiContainer == NULL )
- {
- iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL( ClientRect(), NULL, this );
- iSymbian_ua_guiContainer->SetMopParent( this );
- AppUi()->AddToStackL( *this, iSymbian_ua_guiContainer );
- }
- // ]]] end generated region [Generated Contents]
-
- cba = CEikButtonGroupContainer::Current();
- if (cba != NULL) {
- if (symbian_ua_anycall())
- cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp);
- else
- cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall);
- }
-
- }
-
-/**
- */
-void Csymbian_ua_guiContainerView::DoDeactivate()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- CleanupStatusPane();
-
- CEikButtonGroupContainer* cba = AppUi()->Cba();
- if ( cba != NULL )
- {
- cba->MakeVisible( ETrue );
- cba->DrawDeferred();
- }
-
- if ( iSymbian_ua_guiContainer != NULL )
- {
- AppUi()->RemoveFromViewStack( *this, iSymbian_ua_guiContainer );
- delete iSymbian_ua_guiContainer;
- iSymbian_ua_guiContainer = NULL;
- }
- // ]]] end generated region [Generated Contents]
-
- }
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiContainerView::SetupStatusPaneL()
- {
- // reset the context pane
- TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
- CEikStatusPaneBase::TPaneCapabilities subPaneContext =
- StatusPane()->PaneCapabilities( contextPaneUid );
- if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
- {
- CAknContextPane* context = static_cast< CAknContextPane* > (
- StatusPane()->ControlL( contextPaneUid ) );
- context->SetPictureToDefaultL();
- }
-
- // setup the title pane
- TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
- CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
- StatusPane()->PaneCapabilities( titlePaneUid );
- if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
- {
- CAknTitlePane* title = static_cast< CAknTitlePane* >(
- StatusPane()->ControlL( titlePaneUid ) );
- TResourceReader reader;
- iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE );
- title->SetFromResourceL( reader );
- CleanupStack::PopAndDestroy(); // reader internal state
- }
-
- }
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiContainerView::CleanupStatusPane()
- {
- }
-// ]]] end generated function
-
-/**
- * Handle status pane size change for this view (override)
- */
-void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange()
- {
- CAknView::HandleStatusPaneSizeChange();
-
- // this may fail, but we're not able to propagate exceptions here
- TInt result;
- TRAP( result, SetupStatusPaneL() );
- }
-
-/**
- * Handle the rightSoftKeyPressed event.
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL( TInt aCommand )
- {
- CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_url);
- CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
-
- if (symbian_ua_anycall()) {
- symbian_ua_endcall();
- return ETrue;
- }
-
- PutMessage(_L("Making call..."));
- if ( cba != NULL ) {
- cba->SetCommandL(aCommand, KStHangUp);
- cba->DrawDeferred();
- }
-
-
- TUint8 url[256];
- TPtr8 aUrl(url, 256);
-
- HBufC *buf = obj_url->GetTextInHBufL();
- CnvUtfConverter::ConvertFromUnicodeToUtf8(aUrl, *buf);
- delete buf;
-
- if (symbian_ua_makecall((char *)aUrl.PtrZ()) != 0) {
- PutMessage(_L("Making call failed!"));
- if ( cba != NULL ) {
- cba->SetCommandL(aCommand, KStCall);
- cba->DrawDeferred();
- }
- }
-
- return ETrue;
- }
-
-/**
- * Handle the selected event.
- * @param aCommand the command id invoked
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL( TInt aCommand )
- {
- AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiSettingItemListViewId));
- return ETrue;
- }
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup note for note_error
- * @param aOverrideText optional override text
- */
-void Csymbian_ua_guiContainerView::RunNote_errorL( const TDesC* aOverrideText )
- {
- CAknErrorNote* note = new ( ELeave ) CAknErrorNote();
- if ( aOverrideText == NULL )
- {
- HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR );
- note->ExecuteLD( *noteText );
- CleanupStack::PopAndDestroy( noteText );
- }
- else
- {
- note->ExecuteLD( *aOverrideText );
- }
- }
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup note for note_info
- * @param aOverrideText optional override text
- */
-void Csymbian_ua_guiContainerView::RunNote_infoL( const TDesC* aOverrideText )
- {
- CAknInformationNote* note = new ( ELeave ) CAknInformationNote();
- if ( aOverrideText == NULL )
- {
- HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO );
- note->ExecuteLD( *noteText );
- CleanupStack::PopAndDestroy( noteText );
- }
- else
- {
- note->ExecuteLD( *aOverrideText );
- }
- }
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup note for note_warning
- * @param aOverrideText optional override text
- */
-void Csymbian_ua_guiContainerView::RunNote_warningL( const TDesC* aOverrideText )
- {
- CAknWarningNote* note = new ( ELeave ) CAknWarningNote();
- if ( aOverrideText == NULL )
- {
- HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING );
- note->ExecuteLD( *noteText );
- CleanupStack::PopAndDestroy( noteText );
- }
- else
- {
- note->ExecuteLD( *aOverrideText );
- }
- }
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-/**
- * Show the popup dialog for qry_accept_call
- * @param aOverrideText optional override text
- * @return EAknSoftkeyYes (left soft key id) or 0
- */
-TInt Csymbian_ua_guiContainerView::RunQry_accept_callL( const TDesC* aOverrideText )
- {
-
- CAknQueryDialog* queryDialog = CAknQueryDialog::NewL();
-
- if ( aOverrideText != NULL )
- {
- queryDialog->SetPromptL( *aOverrideText );
- }
- return queryDialog->ExecuteLD( R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL );
- }
-// ]]] end generated function
-
+/* +======================================================================== + Name : symbian_ua_guiContainerView.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <aknviewappui.h> +#include <eikmenub.h> +#include <avkon.hrh> +#include <barsread.h> +#include <stringloader.h> +#include <eiklabel.h> +#include <eikenv.h> +#include <gdi.h> +#include <eikedwin.h> +#include <akncontext.h> +#include <akntitle.h> +#include <eikbtgpc.h> +#include <aknnotewrappers.h> +#include <aknquerydialog.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiContainerView.h" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_guiContainer.h" +// ]]] end generated region [Generated User Includes] + +#include <utf.h> +#include "symbian_ua.h" + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +Csymbian_ua_guiContainerView *myinstance = NULL; +_LIT(KStCall, "Call"); +_LIT(KStHangUp, "Hang Up"); + +void on_info(const wchar_t* buf) +{ + TPtrC aBuf((const TUint16*)buf); + + if (myinstance) + myinstance->PutMessage(aBuf); +} + +void on_incoming_call(const wchar_t* caller_disp, const wchar_t* caller_uri) +{ + TBuf<512> buf; + TPtrC aDisp((const TUint16*)caller_disp); + TPtrC aUri((const TUint16*)caller_uri); + _LIT(KFormat, "Incoming call from %S, accept?"); + + buf.Format(KFormat, &aDisp); + if (Csymbian_ua_guiContainerView::RunQry_accept_callL(&buf) == EAknSoftkeyYes) + { + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp)); + cba->DrawDeferred(); + } + symbian_ua_answercall(); + } else { + symbian_ua_endcall(); + } +} + +void on_call_end(const wchar_t* reason) +{ + TPtrC aReason((const TUint16*)reason); + + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + TRAPD(result, cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall)); + cba->DrawDeferred(); + } + + Csymbian_ua_guiContainerView::RunNote_infoL(&aReason); +} + +void on_reg_state(bool success) +{ + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL(); + else + Csymbian_ua_guiContainerView::RunNote_warningL(); +} + +void on_unreg_state(bool success) +{ + TPtrC st_success(_L("Unregistration Success!")); + TPtrC st_failed(_L("Unregistration Failed!")); + + if (success) + Csymbian_ua_guiContainerView::RunNote_infoL(&st_success); + else + Csymbian_ua_guiContainerView::RunNote_warningL(&st_failed); +} + +void Csymbian_ua_guiContainerView::PutMessage(const TDesC &msg) + { + if (!iSymbian_ua_guiContainer) + return; + + CEikEdwin *obj_info = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_info); + + obj_info->SetTextL(&msg); + obj_info->DrawDeferred(); + } + +/** + * First phase of Symbian two-phase construction. Should not contain any + * code that could leave. + */ +Csymbian_ua_guiContainerView::Csymbian_ua_guiContainerView() + { + // [[[ begin generated region: do not modify [Generated Contents] + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + + } +/** + * The view's destructor removes the container from the control + * stack and destroys it. + */ +Csymbian_ua_guiContainerView::~Csymbian_ua_guiContainerView() + { + // [[[ begin generated region: do not modify [Generated Contents] + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + // ]]] end generated region [Generated Contents] + + symbian_ua_set_info_callback(NULL); + myinstance = NULL; + } + +/** + * Symbian two-phase constructor. + * This creates an instance then calls the second-phase constructor + * without leaving the instance on the cleanup stack. + * @return new instance of Csymbian_ua_guiContainerView + */ +Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewL() + { + Csymbian_ua_guiContainerView* self = Csymbian_ua_guiContainerView::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +/** + * Symbian two-phase constructor. + * This creates an instance, pushes it on the cleanup stack, + * then calls the second-phase constructor. + * @return new instance of Csymbian_ua_guiContainerView + */ +Csymbian_ua_guiContainerView* Csymbian_ua_guiContainerView::NewLC() + { + Csymbian_ua_guiContainerView* self = new ( ELeave ) Csymbian_ua_guiContainerView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +/** + * Second-phase constructor for view. + * Initialize contents from resource. + */ +void Csymbian_ua_guiContainerView::ConstructL() + { + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL( R_SYMBIAN_UA_GUI_CONTAINER_SYMBIAN_UA_GUI_CONTAINER_VIEW ); + // ]]] end generated region [Generated Code] + + // add your own initialization code here + symbian_ua_info_cb_t cb; + Mem::FillZ(&cb, sizeof(cb)); + + cb.on_info = &on_info; + cb.on_incoming_call = &on_incoming_call; + cb.on_reg_state = &on_reg_state; + cb.on_unreg_state = &on_unreg_state; + cb.on_call_end = &on_call_end; + + symbian_ua_set_info_callback(&cb); + myinstance = this; + } + +/** + * @return The UID for this view + */ +TUid Csymbian_ua_guiContainerView::Id() const + { + return TUid::Uid( ESymbian_ua_guiContainerViewId ); + } + +/** + * Handle a command for this view (override) + * @param aCommand command id to be handled + */ +void Csymbian_ua_guiContainerView::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AknView's menu and CBA commands is generated here + + case ESymbian_ua_guiContainerViewControlPaneRightId: + commandHandled = CallSoftKeyPressedL( aCommand ); + break; + case ESymbian_ua_guiContainerViewSettingMenuItemCommand: + commandHandled = HandleSettingMenuItemSelectedL( aCommand ); + break; + default: + break; + } + + + if ( !commandHandled ) + { + + if ( aCommand == ESymbian_ua_guiContainerViewControlPaneRightId ) + { + AppUi()->HandleCommandL( EEikCmdExit ); + } + + } + // ]]] end generated region [Generated Code] + + } + +/** + * Handles user actions during activation of the view, + * such as initializing the content. + */ +void Csymbian_ua_guiContainerView::DoActivateL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( EFalse ); + } + + if ( iSymbian_ua_guiContainer == NULL ) + { + iSymbian_ua_guiContainer = CSymbian_ua_guiContainer::NewL( ClientRect(), NULL, this ); + iSymbian_ua_guiContainer->SetMopParent( this ); + AppUi()->AddToStackL( *this, iSymbian_ua_guiContainer ); + } + // ]]] end generated region [Generated Contents] + + cba = CEikButtonGroupContainer::Current(); + if (cba != NULL) { + if (symbian_ua_anycall()) + cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStHangUp); + else + cba->SetCommandL(ESymbian_ua_guiContainerViewControlPaneRightId, KStCall); + } + + } + +/** + */ +void Csymbian_ua_guiContainerView::DoDeactivate() + { + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( ETrue ); + cba->DrawDeferred(); + } + + if ( iSymbian_ua_guiContainer != NULL ) + { + AppUi()->RemoveFromViewStack( *this, iSymbian_ua_guiContainer ); + delete iSymbian_ua_guiContainer; + iSymbian_ua_guiContainer = NULL; + } + // ]]] end generated region [Generated Contents] + + } + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiContainerView::SetupStatusPaneL() + { + // reset the context pane + TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities( contextPaneUid ); + if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) + { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL( contextPaneUid ) ); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = static_cast< CAknTitlePane* >( + StatusPane()->ControlL( titlePaneUid ) ); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_CONTAINER_TITLE_RESOURCE ); + title->SetFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + + } +// ]]] end generated function + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiContainerView::CleanupStatusPane() + { + } +// ]]] end generated function + +/** + * Handle status pane size change for this view (override) + */ +void Csymbian_ua_guiContainerView::HandleStatusPaneSizeChange() + { + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP( result, SetupStatusPaneL() ); + } + +/** + * Handle the rightSoftKeyPressed event. + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiContainerView::CallSoftKeyPressedL( TInt aCommand ) + { + CEikEdwin *obj_url = (CEikEdwin*) iSymbian_ua_guiContainer->ComponentControl(iSymbian_ua_guiContainer->EEd_url); + CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); + + if (symbian_ua_anycall()) { + symbian_ua_endcall(); + return ETrue; + } + + PutMessage(_L("Making call...")); + if ( cba != NULL ) { + cba->SetCommandL(aCommand, KStHangUp); + cba->DrawDeferred(); + } + + + TUint8 url[256]; + TPtr8 aUrl(url, 256); + + HBufC *buf = obj_url->GetTextInHBufL(); + CnvUtfConverter::ConvertFromUnicodeToUtf8(aUrl, *buf); + delete buf; + + if (symbian_ua_makecall((char *)aUrl.PtrZ()) != 0) { + PutMessage(_L("Making call failed!")); + if ( cba != NULL ) { + cba->SetCommandL(aCommand, KStCall); + cba->DrawDeferred(); + } + } + + return ETrue; + } + +/** + * Handle the selected event. + * @param aCommand the command id invoked + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiContainerView::HandleSettingMenuItemSelectedL( TInt aCommand ) + { + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiSettingItemListViewId)); + return ETrue; + } + +// [[[ begin generated function: do not modify +/** + * Show the popup note for note_error + * @param aOverrideText optional override text + */ +void Csymbian_ua_guiContainerView::RunNote_errorL( const TDesC* aOverrideText ) + { + CAknErrorNote* note = new ( ELeave ) CAknErrorNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_ERROR ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Show the popup note for note_info + * @param aOverrideText optional override text + */ +void Csymbian_ua_guiContainerView::RunNote_infoL( const TDesC* aOverrideText ) + { + CAknInformationNote* note = new ( ELeave ) CAknInformationNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_INFO ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Show the popup note for note_warning + * @param aOverrideText optional override text + */ +void Csymbian_ua_guiContainerView::RunNote_warningL( const TDesC* aOverrideText ) + { + CAknWarningNote* note = new ( ELeave ) CAknWarningNote(); + if ( aOverrideText == NULL ) + { + HBufC* noteText = StringLoader::LoadLC( R_SYMBIAN_UA_GUI_CONTAINER_NOTE_WARNING ); + note->ExecuteLD( *noteText ); + CleanupStack::PopAndDestroy( noteText ); + } + else + { + note->ExecuteLD( *aOverrideText ); + } + } +// ]]] end generated function + +// [[[ begin generated function: do not modify +/** + * Show the popup dialog for qry_accept_call + * @param aOverrideText optional override text + * @return EAknSoftkeyYes (left soft key id) or 0 + */ +TInt Csymbian_ua_guiContainerView::RunQry_accept_callL( const TDesC* aOverrideText ) + { + + CAknQueryDialog* queryDialog = CAknQueryDialog::NewL(); + + if ( aOverrideText != NULL ) + { + queryDialog->SetPromptL( *aOverrideText ); + } + return queryDialog->ExecuteLD( R_SYMBIAN_UA_GUI_CONTAINER_QRY_ACCEPT_CALL ); + } +// ]]] end generated function + diff --git a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp index 8eb54f8d..54efa4bb 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiDocument.cpp @@ -1,57 +1,57 @@ -/*
-========================================================================
- Name : symbian_ua_guiDocument.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_guiDocument.h"
-#include "symbian_ua_guiAppUi.h"
-// ]]] end generated region [Generated User Includes]
-
-/**
- * @brief Constructs the document class for the application.
- * @param anApplication the application instance
- */
-Csymbian_ua_guiDocument::Csymbian_ua_guiDocument( CEikApplication& anApplication )
- : CAknDocument( anApplication )
- {
- }
-
-/**
- * @brief Completes the second phase of Symbian object construction.
- * Put initialization code that could leave here.
- */
-void Csymbian_ua_guiDocument::ConstructL()
- {
- }
-
-/**
- * Symbian OS two-phase constructor.
- *
- * Creates an instance of Csymbian_ua_guiDocument, constructs it, and
- * returns it.
- *
- * @param aApp the application instance
- * @return the new Csymbian_ua_guiDocument
- */
-Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL( CEikApplication& aApp )
- {
- Csymbian_ua_guiDocument* self = new ( ELeave ) Csymbian_ua_guiDocument( aApp );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-/**
- * @brief Creates the application UI object for this document.
- * @return the new instance
- */
-CEikAppUi* Csymbian_ua_guiDocument::CreateAppUiL()
- {
- return new ( ELeave ) Csymbian_ua_guiAppUi;
- }
-
+/* +======================================================================== + Name : symbian_ua_guiDocument.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_guiDocument.h" +#include "symbian_ua_guiAppUi.h" +// ]]] end generated region [Generated User Includes] + +/** + * @brief Constructs the document class for the application. + * @param anApplication the application instance + */ +Csymbian_ua_guiDocument::Csymbian_ua_guiDocument( CEikApplication& anApplication ) + : CAknDocument( anApplication ) + { + } + +/** + * @brief Completes the second phase of Symbian object construction. + * Put initialization code that could leave here. + */ +void Csymbian_ua_guiDocument::ConstructL() + { + } + +/** + * Symbian OS two-phase constructor. + * + * Creates an instance of Csymbian_ua_guiDocument, constructs it, and + * returns it. + * + * @param aApp the application instance + * @return the new Csymbian_ua_guiDocument + */ +Csymbian_ua_guiDocument* Csymbian_ua_guiDocument::NewL( CEikApplication& aApp ) + { + Csymbian_ua_guiDocument* self = new ( ELeave ) Csymbian_ua_guiDocument( aApp ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +/** + * @brief Creates the application UI object for this document. + * @return the new instance + */ +CEikAppUi* Csymbian_ua_guiDocument::CreateAppUiL() + { + return new ( ELeave ) Csymbian_ua_guiAppUi; + } + diff --git a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp index 27f3d6e5..88204a56 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemList.cpp @@ -1,423 +1,423 @@ -/*
-========================================================================
- Name : symbian_ua_guiSettingItemList.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <avkon.hrh>
-#include <avkon.rsg>
-#include <eikmenup.h>
-#include <aknappui.h>
-#include <eikcmobs.h>
-#include <barsread.h>
-#include <stringloader.h>
-#include <gdi.h>
-#include <eikedwin.h>
-#include <eikenv.h>
-#include <eikseced.h>
-#include <aknpopupfieldtext.h>
-#include <eikappui.h>
-#include <aknviewappui.h>
-#include <akntextsettingpage.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_guiSettingItemList.h"
-#include "Symbian_ua_guiSettingItemListSettings.h"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiSettingItemListView.h"
-// ]]] end generated region [Generated User Includes]
-
-
-#include <s32stor.h>
-#include <s32file.h>
-
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-
-_LIT(KtxDicFileName ,"settings.ini" );
-
-const TInt KRegistrar = 2;
-const TInt KUsername = 3;
-const TInt KPassword = 4;
-const TInt KStunServer = 5;
-const TInt KSrtp = 6;
-const TInt KIce = 7;
-
-/**
- * Construct the CSymbian_ua_guiSettingItemList instance
- * @param aCommandObserver command observer
- */
-CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList(
- TSymbian_ua_guiSettingItemListSettings& aSettings,
- MEikCommandObserver* aCommandObserver )
- : iSettings( aSettings ), iCommandObserver( aCommandObserver )
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-/**
- * Destroy any instance variables
- */
-CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- * Handle system notification that the container's size has changed.
- */
-void CSymbian_ua_guiSettingItemList::SizeChanged()
- {
- if ( ListBox() )
- {
- ListBox()->SetRect( Rect() );
- }
- }
-
-/**
- * Create one setting item at a time, identified by id.
- * CAknSettingItemList calls this method and takes ownership
- * of the returned value. The CAknSettingItem object owns
- * a reference to the underlying data, which EditItemL() uses
- * to edit and store the value.
- */
-CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL( TInt aId )
- {
- switch ( aId )
- {
- // [[[ begin generated region: do not modify [Initializers]
- case ESymbian_ua_guiSettingItemListViewEd_registrar:
- {
- CAknTextSettingItem* item = new ( ELeave )
- CAknTextSettingItem(
- aId,
- iSettings.Ed_registrar() );
- item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
- return item;
- }
- case ESymbian_ua_guiSettingItemListViewEd_user:
- {
- CAknTextSettingItem* item = new ( ELeave )
- CAknTextSettingItem(
- aId,
- iSettings.Ed_user() );
- item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
- return item;
- }
- case ESymbian_ua_guiSettingItemListViewEd_password:
- {
- CAknPasswordSettingItem* item = new ( ELeave )
- CAknPasswordSettingItem(
- aId,
- CAknPasswordSettingItem::EAlpha,
- iSettings.Ed_password() );
- item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
- return item;
- }
- case ESymbian_ua_guiSettingItemListViewB_srtp:
- {
- CAknBinaryPopupSettingItem* item = new ( ELeave )
- CAknBinaryPopupSettingItem(
- aId,
- iSettings.B_srtp() );
- item->SetHidden( ETrue );
- return item;
- }
- case ESymbian_ua_guiSettingItemListViewB_ice:
- {
- CAknBinaryPopupSettingItem* item = new ( ELeave )
- CAknBinaryPopupSettingItem(
- aId,
- iSettings.B_ice() );
- item->SetHidden( ETrue );
- return item;
- }
- case ESymbian_ua_guiSettingItemListViewEd_stun_server:
- {
- CAknTextSettingItem* item = new ( ELeave )
- CAknTextSettingItem(
- aId,
- iSettings.Ed_stun_server() );
- item->SetHidden( ETrue );
- return item;
- }
- // ]]] end generated region [Initializers]
-
- }
-
- return NULL;
- }
-
-/**
- * Edit the setting item identified by the given id and store
- * the changes into the store.
- * @param aIndex the index of the setting item in SettingItemArray()
- * @param aCalledFromMenu true: a menu item invoked editing, thus
- * always show the edit page and interactively edit the item;
- * false: change the item in place if possible, else show the edit page
- */
-void CSymbian_ua_guiSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
- {
- CAknSettingItem* item = ( *SettingItemArray() )[aIndex];
- switch ( item->Identifier() )
- {
- // [[[ begin generated region: do not modify [Editing Started Invoker]
- // ]]] end generated region [Editing Started Invoker]
-
- }
-
- CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
-
- TBool storeValue = ETrue;
- switch ( item->Identifier() )
- {
- // [[[ begin generated region: do not modify [Editing Stopped Invoker]
- // ]]] end generated region [Editing Stopped Invoker]
-
- }
-
- if ( storeValue )
- {
- item->StoreL();
- SaveSettingValuesL();
- }
- }
-/**
- * Handle the "Change" option on the Options menu. This is an
- * alternative to the Selection key that forces the settings page
- * to come up rather than changing the value in place (if possible).
- */
-void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL()
- {
- if ( ListBox()->CurrentItemIndex() >= 0 )
- {
- EditItemL( ListBox()->CurrentItemIndex(), ETrue );
- }
- }
-
-/**
- * Load the initial contents of the setting items. By default,
- * the setting items are populated with the default values from
- * the design. You can override those values here.
- * <p>
- * Note: this call alone does not update the UI.
- * LoadSettingsL() must be called afterwards.
- */
-void CSymbian_ua_guiSettingItemList::LoadSettingValuesL()
- {
- // load values into iSettings
-
- TFileName path;
- TFileName pathWithoutDrive;
- CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive );
-
- // Extract drive letter into appDrive:
-#ifdef __WINS__
- path.Copy( _L("c:") );
-#else
- RProcess process;
- path.Copy( process.FileName().Left(2) );
-#endif
-
- path.Append( pathWithoutDrive );
- path.Append( KtxDicFileName );
-
- TFindFile AufFolder(CCoeEnv::Static()->FsSession());
- if(KErrNone == AufFolder.FindByDir(path, KNullDesC))
- {
- CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(1));
- TUid FileUid;
-
- FileUid.iUid = KRegistrar;
- if(MyDStore->IsPresentL(FileUid))
- {
- RDictionaryReadStream in;
- in.OpenLC(*MyDStore,FileUid);
- in >> iSettings.Ed_registrar();
- CleanupStack::PopAndDestroy(1);// in
- }
-
- FileUid.iUid = KUsername;
- if(MyDStore->IsPresentL(FileUid))
- {
- RDictionaryReadStream in;
- in.OpenLC(*MyDStore,FileUid);
- in >> iSettings.Ed_user();
- CleanupStack::PopAndDestroy(1);// in
- }
-
- FileUid.iUid = KPassword;
- if(MyDStore->IsPresentL(FileUid))
- {
- RDictionaryReadStream in;
- in.OpenLC(*MyDStore,FileUid);
- in >> iSettings.Ed_password();
- CleanupStack::PopAndDestroy(1);// in
- }
-
- FileUid.iUid = KStunServer;
- if(MyDStore->IsPresentL(FileUid))
- {
- RDictionaryReadStream in;
- in.OpenLC(*MyDStore,FileUid);
- in >> iSettings.Ed_stun_server();
- CleanupStack::PopAndDestroy(1);// in
- }
-
- FileUid.iUid = KSrtp;
- if(MyDStore->IsPresentL(FileUid))
- {
- RDictionaryReadStream in;
- in.OpenLC(*MyDStore,FileUid);
- iSettings.SetB_srtp((TBool)in.ReadInt32L());
- CleanupStack::PopAndDestroy(1);// in
- }
-
- FileUid.iUid = KIce;
- if(MyDStore->IsPresentL(FileUid))
- {
- RDictionaryReadStream in;
- in.OpenLC(*MyDStore,FileUid);
- iSettings.SetB_ice((TBool)in.ReadInt32L());
- CleanupStack::PopAndDestroy(1);// in
- }
-
- CleanupStack::PopAndDestroy(1);// Store
- }
-
- }
-
-/**
- * Save the contents of the setting items. Note, this is called
- * whenever an item is changed and stored to the model, so it
- * may be called multiple times or not at all.
- */
-void CSymbian_ua_guiSettingItemList::SaveSettingValuesL()
- {
- // store values from iSettings
-
- TFileName path;
- TFileName pathWithoutDrive;
- CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive );
-
- // Extract drive letter into appDrive:
-#ifdef __WINS__
- path.Copy( _L("c:") );
-#else
- RProcess process;
- path.Copy( process.FileName().Left(2) );
-
- if(path.Compare(_L("c")) || path.Compare(_L("C")))
- CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC);
- else if(path.Compare(_L("e")) || path.Compare(_L("E")))
- CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE);
-#endif
-
- path.Append( pathWithoutDrive );
- path.Append( KtxDicFileName );
-
- TFindFile AufFolder(CCoeEnv::Static()->FsSession());
- if(KErrNone == AufFolder.FindByDir(path, KNullDesC))
- {
- User::LeaveIfError(CCoeEnv::Static()->FsSession().Delete(AufFolder.File()));
- }
-
- CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),path, TUid::Uid(1));
-
- TUid FileUid = {0x0};
-
- FileUid.iUid = KRegistrar;
- RDictionaryWriteStream out1;
- out1.AssignLC(*MyDStore,FileUid);
- out1 << iSettings.Ed_registrar();
- out1.CommitL();
- CleanupStack::PopAndDestroy(1);// out2
-
- FileUid.iUid = KUsername;
- RDictionaryWriteStream out2;
- out2.AssignLC(*MyDStore,FileUid);
- out2 << iSettings.Ed_user();
- out2.CommitL();
- CleanupStack::PopAndDestroy(1);// out2
-
- FileUid.iUid = KPassword;
- RDictionaryWriteStream out3;
- out3.AssignLC(*MyDStore,FileUid);
- out3 << iSettings.Ed_password();
- out3.CommitL();
- CleanupStack::PopAndDestroy(1);// out2
-
- FileUid.iUid = KStunServer;
- RDictionaryWriteStream out4;
- out4.AssignLC(*MyDStore,FileUid);
- out4 << iSettings.Ed_stun_server();
- out4.CommitL();
- CleanupStack::PopAndDestroy(1);// out2
-
- FileUid.iUid = KSrtp;
- RDictionaryWriteStream out5;
- out5.AssignLC(*MyDStore,FileUid);
- out5.WriteInt32L(iSettings.B_srtp());
- out5.CommitL();
- CleanupStack::PopAndDestroy(1);// out1
-
- FileUid.iUid = KIce;
- RDictionaryWriteStream out6;
- out6.AssignLC(*MyDStore,FileUid);
- out6.WriteInt32L(iSettings.B_ice());
- out6.CommitL();
- CleanupStack::PopAndDestroy(1);// out1
-
- MyDStore->CommitL();
- CleanupStack::PopAndDestroy(1);// Store
-
- }
-
-
-/**
- * Handle global resource changes, such as scalable UI or skin events (override)
- */
-void CSymbian_ua_guiSettingItemList::HandleResourceChange( TInt aType )
- {
- CAknSettingItemList::HandleResourceChange( aType );
- SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiSettingItemListViewId ) )->ClientRect() );
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- * Handle key event (override)
- * @param aKeyEvent key event
- * @param aType event code
- * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed
- */
-TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL(
- const TKeyEvent& aKeyEvent,
- TEventCode aType )
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- if ( aKeyEvent.iCode == EKeyLeftArrow
- || aKeyEvent.iCode == EKeyRightArrow )
- {
- // allow the tab control to get the arrow keys
- return EKeyWasNotConsumed;
- }
-
- return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType );
- }
-
+/* +======================================================================== + Name : symbian_ua_guiSettingItemList.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ + +// [[[ begin generated region: do not modify [Generated System Includes] +#include <avkon.hrh> +#include <avkon.rsg> +#include <eikmenup.h> +#include <aknappui.h> +#include <eikcmobs.h> +#include <barsread.h> +#include <stringloader.h> +#include <gdi.h> +#include <eikedwin.h> +#include <eikenv.h> +#include <eikseced.h> +#include <aknpopupfieldtext.h> +#include <eikappui.h> +#include <aknviewappui.h> +#include <akntextsettingpage.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_guiSettingItemList.h" +#include "Symbian_ua_guiSettingItemListSettings.h" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiSettingItemListView.h" +// ]]] end generated region [Generated User Includes] + + +#include <s32stor.h> +#include <s32file.h> + + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + + +_LIT(KtxDicFileName ,"settings.ini" ); + +const TInt KRegistrar = 2; +const TInt KUsername = 3; +const TInt KPassword = 4; +const TInt KStunServer = 5; +const TInt KSrtp = 6; +const TInt KIce = 7; + +/** + * Construct the CSymbian_ua_guiSettingItemList instance + * @param aCommandObserver command observer + */ +CSymbian_ua_guiSettingItemList::CSymbian_ua_guiSettingItemList( + TSymbian_ua_guiSettingItemListSettings& aSettings, + MEikCommandObserver* aCommandObserver ) + : iSettings( aSettings ), iCommandObserver( aCommandObserver ) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } +/** + * Destroy any instance variables + */ +CSymbian_ua_guiSettingItemList::~CSymbian_ua_guiSettingItemList() + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** + * Handle system notification that the container's size has changed. + */ +void CSymbian_ua_guiSettingItemList::SizeChanged() + { + if ( ListBox() ) + { + ListBox()->SetRect( Rect() ); + } + } + +/** + * Create one setting item at a time, identified by id. + * CAknSettingItemList calls this method and takes ownership + * of the returned value. The CAknSettingItem object owns + * a reference to the underlying data, which EditItemL() uses + * to edit and store the value. + */ +CAknSettingItem* CSymbian_ua_guiSettingItemList::CreateSettingItemL( TInt aId ) + { + switch ( aId ) + { + // [[[ begin generated region: do not modify [Initializers] + case ESymbian_ua_guiSettingItemListViewEd_registrar: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_registrar() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_user: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_user() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_password: + { + CAknPasswordSettingItem* item = new ( ELeave ) + CAknPasswordSettingItem( + aId, + CAknPasswordSettingItem::EAlpha, + iSettings.Ed_password() ); + item->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed); + return item; + } + case ESymbian_ua_guiSettingItemListViewB_srtp: + { + CAknBinaryPopupSettingItem* item = new ( ELeave ) + CAknBinaryPopupSettingItem( + aId, + iSettings.B_srtp() ); + item->SetHidden( ETrue ); + return item; + } + case ESymbian_ua_guiSettingItemListViewB_ice: + { + CAknBinaryPopupSettingItem* item = new ( ELeave ) + CAknBinaryPopupSettingItem( + aId, + iSettings.B_ice() ); + item->SetHidden( ETrue ); + return item; + } + case ESymbian_ua_guiSettingItemListViewEd_stun_server: + { + CAknTextSettingItem* item = new ( ELeave ) + CAknTextSettingItem( + aId, + iSettings.Ed_stun_server() ); + item->SetHidden( ETrue ); + return item; + } + // ]]] end generated region [Initializers] + + } + + return NULL; + } + +/** + * Edit the setting item identified by the given id and store + * the changes into the store. + * @param aIndex the index of the setting item in SettingItemArray() + * @param aCalledFromMenu true: a menu item invoked editing, thus + * always show the edit page and interactively edit the item; + * false: change the item in place if possible, else show the edit page + */ +void CSymbian_ua_guiSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu ) + { + CAknSettingItem* item = ( *SettingItemArray() )[aIndex]; + switch ( item->Identifier() ) + { + // [[[ begin generated region: do not modify [Editing Started Invoker] + // ]]] end generated region [Editing Started Invoker] + + } + + CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu ); + + TBool storeValue = ETrue; + switch ( item->Identifier() ) + { + // [[[ begin generated region: do not modify [Editing Stopped Invoker] + // ]]] end generated region [Editing Stopped Invoker] + + } + + if ( storeValue ) + { + item->StoreL(); + SaveSettingValuesL(); + } + } +/** + * Handle the "Change" option on the Options menu. This is an + * alternative to the Selection key that forces the settings page + * to come up rather than changing the value in place (if possible). + */ +void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL() + { + if ( ListBox()->CurrentItemIndex() >= 0 ) + { + EditItemL( ListBox()->CurrentItemIndex(), ETrue ); + } + } + +/** + * Load the initial contents of the setting items. By default, + * the setting items are populated with the default values from + * the design. You can override those values here. + * <p> + * Note: this call alone does not update the UI. + * LoadSettingsL() must be called afterwards. + */ +void CSymbian_ua_guiSettingItemList::LoadSettingValuesL() + { + // load values into iSettings + + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); + + // Extract drive letter into appDrive: +#ifdef __WINS__ + path.Copy( _L("c:") ); +#else + RProcess process; + path.Copy( process.FileName().Left(2) ); +#endif + + path.Append( pathWithoutDrive ); + path.Append( KtxDicFileName ); + + TFindFile AufFolder(CCoeEnv::Static()->FsSession()); + if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) + { + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(1)); + TUid FileUid; + + FileUid.iUid = KRegistrar; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_registrar(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KUsername; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_user(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KPassword; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_password(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KStunServer; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + in >> iSettings.Ed_stun_server(); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KSrtp; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + iSettings.SetB_srtp((TBool)in.ReadInt32L()); + CleanupStack::PopAndDestroy(1);// in + } + + FileUid.iUid = KIce; + if(MyDStore->IsPresentL(FileUid)) + { + RDictionaryReadStream in; + in.OpenLC(*MyDStore,FileUid); + iSettings.SetB_ice((TBool)in.ReadInt32L()); + CleanupStack::PopAndDestroy(1);// in + } + + CleanupStack::PopAndDestroy(1);// Store + } + + } + +/** + * Save the contents of the setting items. Note, this is called + * whenever an item is changed and stored to the model, so it + * may be called multiple times or not at all. + */ +void CSymbian_ua_guiSettingItemList::SaveSettingValuesL() + { + // store values from iSettings + + TFileName path; + TFileName pathWithoutDrive; + CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive ); + + // Extract drive letter into appDrive: +#ifdef __WINS__ + path.Copy( _L("c:") ); +#else + RProcess process; + path.Copy( process.FileName().Left(2) ); + + if(path.Compare(_L("c")) || path.Compare(_L("C"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveC); + else if(path.Compare(_L("e")) || path.Compare(_L("E"))) + CEikonEnv::Static()->FsSession().CreatePrivatePath(EDriveE); +#endif + + path.Append( pathWithoutDrive ); + path.Append( KtxDicFileName ); + + TFindFile AufFolder(CCoeEnv::Static()->FsSession()); + if(KErrNone == AufFolder.FindByDir(path, KNullDesC)) + { + User::LeaveIfError(CCoeEnv::Static()->FsSession().Delete(AufFolder.File())); + } + + CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),path, TUid::Uid(1)); + + TUid FileUid = {0x0}; + + FileUid.iUid = KRegistrar; + RDictionaryWriteStream out1; + out1.AssignLC(*MyDStore,FileUid); + out1 << iSettings.Ed_registrar(); + out1.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KUsername; + RDictionaryWriteStream out2; + out2.AssignLC(*MyDStore,FileUid); + out2 << iSettings.Ed_user(); + out2.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KPassword; + RDictionaryWriteStream out3; + out3.AssignLC(*MyDStore,FileUid); + out3 << iSettings.Ed_password(); + out3.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KStunServer; + RDictionaryWriteStream out4; + out4.AssignLC(*MyDStore,FileUid); + out4 << iSettings.Ed_stun_server(); + out4.CommitL(); + CleanupStack::PopAndDestroy(1);// out2 + + FileUid.iUid = KSrtp; + RDictionaryWriteStream out5; + out5.AssignLC(*MyDStore,FileUid); + out5.WriteInt32L(iSettings.B_srtp()); + out5.CommitL(); + CleanupStack::PopAndDestroy(1);// out1 + + FileUid.iUid = KIce; + RDictionaryWriteStream out6; + out6.AssignLC(*MyDStore,FileUid); + out6.WriteInt32L(iSettings.B_ice()); + out6.CommitL(); + CleanupStack::PopAndDestroy(1);// out1 + + MyDStore->CommitL(); + CleanupStack::PopAndDestroy(1);// Store + + } + + +/** + * Handle global resource changes, such as scalable UI or skin events (override) + */ +void CSymbian_ua_guiSettingItemList::HandleResourceChange( TInt aType ) + { + CAknSettingItemList::HandleResourceChange( aType ); + SetRect( iAvkonViewAppUi->View( TUid::Uid( ESymbian_ua_guiSettingItemListViewId ) )->ClientRect() ); + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** + * Handle key event (override) + * @param aKeyEvent key event + * @param aType event code + * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed + */ +TKeyResponse CSymbian_ua_guiSettingItemList::OfferKeyEventL( + const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + if ( aKeyEvent.iCode == EKeyLeftArrow + || aKeyEvent.iCode == EKeyRightArrow ) + { + // allow the tab control to get the arrow keys + return EKeyWasNotConsumed; + } + + return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType ); + } + diff --git a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp index 243ff994..416a6b39 100644 --- a/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp +++ b/pjsip-apps/src/symbian_ua_gui/src/symbian_ua_guiSettingItemListView.cpp @@ -1,285 +1,285 @@ -/*
-========================================================================
- Name : symbian_ua_guiSettingItemListView.cpp
- Author : nanang
- Copyright : (c) 2008-2009 Teluu Inc.
- Description :
-========================================================================
-*/
-// [[[ begin generated region: do not modify [Generated System Includes]
-#include <aknviewappui.h>
-#include <eikmenub.h>
-#include <avkon.hrh>
-#include <akncontext.h>
-#include <akntitle.h>
-#include <stringloader.h>
-#include <barsread.h>
-#include <eikbtgpc.h>
-#include <symbian_ua_gui.rsg>
-// ]]] end generated region [Generated System Includes]
-
-// [[[ begin generated region: do not modify [Generated User Includes]
-#include "symbian_ua_gui.hrh"
-#include "symbian_ua_guiSettingItemListView.h"
-#include "symbian_ua_guiContainer.hrh"
-#include "symbian_ua_guiSettingItemList.hrh"
-#include "symbian_ua_guiSettingItemList.h"
-// ]]] end generated region [Generated User Includes]
-
-#include "symbian_ua.h"
-
-// [[[ begin generated region: do not modify [Generated Constants]
-// ]]] end generated region [Generated Constants]
-
-/**
- * First phase of Symbian two-phase construction. Should not contain any
- * code that could leave.
- */
-Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-/**
- * The view's destructor removes the container from the control
- * stack and destroys it.
- */
-Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance then calls the second-phase constructor
- * without leaving the instance on the cleanup stack.
- * @return new instance of Csymbian_ua_guiSettingItemListView
- */
-Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL()
- {
- Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-/**
- * Symbian two-phase constructor.
- * This creates an instance, pushes it on the cleanup stack,
- * then calls the second-phase constructor.
- * @return new instance of Csymbian_ua_guiSettingItemListView
- */
-Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC()
- {
- Csymbian_ua_guiSettingItemListView* self = new ( ELeave ) Csymbian_ua_guiSettingItemListView();
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-
-/**
- * Second-phase constructor for view.
- * Initialize contents from resource.
- */
-void Csymbian_ua_guiSettingItemListView::ConstructL()
- {
- // [[[ begin generated region: do not modify [Generated Code]
- BaseConstructL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW );
- // ]]] end generated region [Generated Code]
-
- // add your own initialization code here
- }
-
-/**
- * @return The UID for this view
- */
-TUid Csymbian_ua_guiSettingItemListView::Id() const
- {
- return TUid::Uid( ESymbian_ua_guiSettingItemListViewId );
- }
-
-/**
- * Handle a command for this view (override)
- * @param aCommand command id to be handled
- */
-void Csymbian_ua_guiSettingItemListView::HandleCommandL( TInt aCommand )
- {
- // [[[ begin generated region: do not modify [Generated Code]
- TBool commandHandled = EFalse;
- switch ( aCommand )
- { // code to dispatch to the AknView's menu and CBA commands is generated here
-
- case EAknSoftkeySave:
- commandHandled = HandleControlPaneRightSoftKeyPressedL( aCommand );
- break;
- case ESymbian_ua_guiSettingItemListViewMenuItem1Command:
- commandHandled = HandleChangeSelectedSettingItemL( aCommand );
- break;
- default:
- break;
- }
-
-
- if ( !commandHandled )
- {
-
- }
- // ]]] end generated region [Generated Code]
-
- }
-
-/**
- * Handles user actions during activation of the view,
- * such as initializing the content.
- */
-void Csymbian_ua_guiSettingItemListView::DoActivateL(
- const TVwsViewId& /*aPrevViewId*/,
- TUid /*aCustomMessageId*/,
- const TDesC8& /*aCustomMessage*/ )
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- SetupStatusPaneL();
-
- CEikButtonGroupContainer* cba = AppUi()->Cba();
- if ( cba != NULL )
- {
- cba->MakeVisible( EFalse );
- }
-
- if ( iSymbian_ua_guiSettingItemList == NULL )
- {
- iSettings = TSymbian_ua_guiSettingItemListSettings::NewL();
- iSymbian_ua_guiSettingItemList = new ( ELeave ) CSymbian_ua_guiSettingItemList( *iSettings, this );
- iSymbian_ua_guiSettingItemList->SetMopParent( this );
- iSymbian_ua_guiSettingItemList->ConstructFromResourceL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST );
- iSymbian_ua_guiSettingItemList->ActivateL();
- iSymbian_ua_guiSettingItemList->LoadSettingValuesL();
- iSymbian_ua_guiSettingItemList->LoadSettingsL();
- AppUi()->AddToStackL( *this, iSymbian_ua_guiSettingItemList );
- }
- // ]]] end generated region [Generated Contents]
-
- }
-
-/**
- */
-void Csymbian_ua_guiSettingItemListView::DoDeactivate()
- {
- // [[[ begin generated region: do not modify [Generated Contents]
- CleanupStatusPane();
-
- CEikButtonGroupContainer* cba = AppUi()->Cba();
- if ( cba != NULL )
- {
- cba->MakeVisible( ETrue );
- cba->DrawDeferred();
- }
-
- if ( iSymbian_ua_guiSettingItemList != NULL )
- {
- AppUi()->RemoveFromStack( iSymbian_ua_guiSettingItemList );
- delete iSymbian_ua_guiSettingItemList;
- iSymbian_ua_guiSettingItemList = NULL;
- delete iSettings;
- iSettings = NULL;
- }
- // ]]] end generated region [Generated Contents]
-
- }
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL()
- {
- // reset the context pane
- TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
- CEikStatusPaneBase::TPaneCapabilities subPaneContext =
- StatusPane()->PaneCapabilities( contextPaneUid );
- if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
- {
- CAknContextPane* context = static_cast< CAknContextPane* > (
- StatusPane()->ControlL( contextPaneUid ) );
- context->SetPictureToDefaultL();
- }
-
- // setup the title pane
- TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
- CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
- StatusPane()->PaneCapabilities( titlePaneUid );
- if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
- {
- CAknTitlePane* title = static_cast< CAknTitlePane* >(
- StatusPane()->ControlL( titlePaneUid ) );
- TResourceReader reader;
- iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE );
- title->SetFromResourceL( reader );
- CleanupStack::PopAndDestroy(); // reader internal state
- }
-
- }
-// ]]] end generated function
-
-// [[[ begin generated function: do not modify
-void Csymbian_ua_guiSettingItemListView::CleanupStatusPane()
- {
- }
-// ]]] end generated function
-
-/**
- * Handle status pane size change for this view (override)
- */
-void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange()
- {
- CAknView::HandleStatusPaneSizeChange();
-
- // this may fail, but we're not able to propagate exceptions here
- TInt result;
- TRAP( result, SetupStatusPaneL() );
- }
-
-/**
- * Handle the selected event.
- * @param aCommand the command id invoked
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL( TInt aCommand )
- {
- iSymbian_ua_guiSettingItemList->ChangeSelectedItemL();
- return ETrue;
- }
-
-/**
- * Handle the rightSoftKeyPressed event.
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL( TInt aCommand )
- {
- TUint8 domain[256] = {0};
- TPtr8 cDomain(domain, sizeof(domain));
- TUint8 user[64] = {0};
- TPtr8 cUser(user, sizeof(user));
- TUint8 pass[64] = {0};
- TPtr8 cPass(pass, sizeof(pass));
-
- cDomain.Copy(iSettings->Ed_registrar());
- cUser.Copy(iSettings->Ed_user());
- cPass.Copy(iSettings->Ed_password());
- symbian_ua_set_account((char*)domain, (char*)user, (char*)pass, false, false);
-
- AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId));
- return ETrue;
- }
-
-/**
- * Handle the selected event.
- * @param aCommand the command id invoked
- * @return ETrue if the command was handled, EFalse if not
- */
-TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL( TInt aCommand )
- {
- AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId));
- return ETrue;
- }
-
+/* +======================================================================== + Name : symbian_ua_guiSettingItemListView.cpp + Author : nanang + Copyright : (c) 2008-2009 Teluu Inc. + Description : +======================================================================== +*/ +// [[[ begin generated region: do not modify [Generated System Includes] +#include <aknviewappui.h> +#include <eikmenub.h> +#include <avkon.hrh> +#include <akncontext.h> +#include <akntitle.h> +#include <stringloader.h> +#include <barsread.h> +#include <eikbtgpc.h> +#include <symbian_ua_gui.rsg> +// ]]] end generated region [Generated System Includes] + +// [[[ begin generated region: do not modify [Generated User Includes] +#include "symbian_ua_gui.hrh" +#include "symbian_ua_guiSettingItemListView.h" +#include "symbian_ua_guiContainer.hrh" +#include "symbian_ua_guiSettingItemList.hrh" +#include "symbian_ua_guiSettingItemList.h" +// ]]] end generated region [Generated User Includes] + +#include "symbian_ua.h" + +// [[[ begin generated region: do not modify [Generated Constants] +// ]]] end generated region [Generated Constants] + +/** + * First phase of Symbian two-phase construction. Should not contain any + * code that could leave. + */ +Csymbian_ua_guiSettingItemListView::Csymbian_ua_guiSettingItemListView() + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } +/** + * The view's destructor removes the container from the control + * stack and destroys it. + */ +Csymbian_ua_guiSettingItemListView::~Csymbian_ua_guiSettingItemListView() + { + // [[[ begin generated region: do not modify [Generated Contents] + // ]]] end generated region [Generated Contents] + + } + +/** + * Symbian two-phase constructor. + * This creates an instance then calls the second-phase constructor + * without leaving the instance on the cleanup stack. + * @return new instance of Csymbian_ua_guiSettingItemListView + */ +Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewL() + { + Csymbian_ua_guiSettingItemListView* self = Csymbian_ua_guiSettingItemListView::NewLC(); + CleanupStack::Pop( self ); + return self; + } + +/** + * Symbian two-phase constructor. + * This creates an instance, pushes it on the cleanup stack, + * then calls the second-phase constructor. + * @return new instance of Csymbian_ua_guiSettingItemListView + */ +Csymbian_ua_guiSettingItemListView* Csymbian_ua_guiSettingItemListView::NewLC() + { + Csymbian_ua_guiSettingItemListView* self = new ( ELeave ) Csymbian_ua_guiSettingItemListView(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +/** + * Second-phase constructor for view. + * Initialize contents from resource. + */ +void Csymbian_ua_guiSettingItemListView::ConstructL() + { + // [[[ begin generated region: do not modify [Generated Code] + BaseConstructL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_VIEW ); + // ]]] end generated region [Generated Code] + + // add your own initialization code here + } + +/** + * @return The UID for this view + */ +TUid Csymbian_ua_guiSettingItemListView::Id() const + { + return TUid::Uid( ESymbian_ua_guiSettingItemListViewId ); + } + +/** + * Handle a command for this view (override) + * @param aCommand command id to be handled + */ +void Csymbian_ua_guiSettingItemListView::HandleCommandL( TInt aCommand ) + { + // [[[ begin generated region: do not modify [Generated Code] + TBool commandHandled = EFalse; + switch ( aCommand ) + { // code to dispatch to the AknView's menu and CBA commands is generated here + + case EAknSoftkeySave: + commandHandled = HandleControlPaneRightSoftKeyPressedL( aCommand ); + break; + case ESymbian_ua_guiSettingItemListViewMenuItem1Command: + commandHandled = HandleChangeSelectedSettingItemL( aCommand ); + break; + default: + break; + } + + + if ( !commandHandled ) + { + + } + // ]]] end generated region [Generated Code] + + } + +/** + * Handles user actions during activation of the view, + * such as initializing the content. + */ +void Csymbian_ua_guiSettingItemListView::DoActivateL( + const TVwsViewId& /*aPrevViewId*/, + TUid /*aCustomMessageId*/, + const TDesC8& /*aCustomMessage*/ ) + { + // [[[ begin generated region: do not modify [Generated Contents] + SetupStatusPaneL(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( EFalse ); + } + + if ( iSymbian_ua_guiSettingItemList == NULL ) + { + iSettings = TSymbian_ua_guiSettingItemListSettings::NewL(); + iSymbian_ua_guiSettingItemList = new ( ELeave ) CSymbian_ua_guiSettingItemList( *iSettings, this ); + iSymbian_ua_guiSettingItemList->SetMopParent( this ); + iSymbian_ua_guiSettingItemList->ConstructFromResourceL( R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_SYMBIAN_UA_GUI_SETTING_ITEM_LIST ); + iSymbian_ua_guiSettingItemList->ActivateL(); + iSymbian_ua_guiSettingItemList->LoadSettingValuesL(); + iSymbian_ua_guiSettingItemList->LoadSettingsL(); + AppUi()->AddToStackL( *this, iSymbian_ua_guiSettingItemList ); + } + // ]]] end generated region [Generated Contents] + + } + +/** + */ +void Csymbian_ua_guiSettingItemListView::DoDeactivate() + { + // [[[ begin generated region: do not modify [Generated Contents] + CleanupStatusPane(); + + CEikButtonGroupContainer* cba = AppUi()->Cba(); + if ( cba != NULL ) + { + cba->MakeVisible( ETrue ); + cba->DrawDeferred(); + } + + if ( iSymbian_ua_guiSettingItemList != NULL ) + { + AppUi()->RemoveFromStack( iSymbian_ua_guiSettingItemList ); + delete iSymbian_ua_guiSettingItemList; + iSymbian_ua_guiSettingItemList = NULL; + delete iSettings; + iSettings = NULL; + } + // ]]] end generated region [Generated Contents] + + } + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiSettingItemListView::SetupStatusPaneL() + { + // reset the context pane + TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext ); + CEikStatusPaneBase::TPaneCapabilities subPaneContext = + StatusPane()->PaneCapabilities( contextPaneUid ); + if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() ) + { + CAknContextPane* context = static_cast< CAknContextPane* > ( + StatusPane()->ControlL( contextPaneUid ) ); + context->SetPictureToDefaultL(); + } + + // setup the title pane + TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle ); + CEikStatusPaneBase::TPaneCapabilities subPaneTitle = + StatusPane()->PaneCapabilities( titlePaneUid ); + if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() ) + { + CAknTitlePane* title = static_cast< CAknTitlePane* >( + StatusPane()->ControlL( titlePaneUid ) ); + TResourceReader reader; + iEikonEnv->CreateResourceReaderLC( reader, R_SYMBIAN_UA_GUI_SETTING_ITEM_LIST_TITLE_RESOURCE ); + title->SetFromResourceL( reader ); + CleanupStack::PopAndDestroy(); // reader internal state + } + + } +// ]]] end generated function + +// [[[ begin generated function: do not modify +void Csymbian_ua_guiSettingItemListView::CleanupStatusPane() + { + } +// ]]] end generated function + +/** + * Handle status pane size change for this view (override) + */ +void Csymbian_ua_guiSettingItemListView::HandleStatusPaneSizeChange() + { + CAknView::HandleStatusPaneSizeChange(); + + // this may fail, but we're not able to propagate exceptions here + TInt result; + TRAP( result, SetupStatusPaneL() ); + } + +/** + * Handle the selected event. + * @param aCommand the command id invoked + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiSettingItemListView::HandleChangeSelectedSettingItemL( TInt aCommand ) + { + iSymbian_ua_guiSettingItemList->ChangeSelectedItemL(); + return ETrue; + } + +/** + * Handle the rightSoftKeyPressed event. + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiSettingItemListView::HandleControlPaneRightSoftKeyPressedL( TInt aCommand ) + { + TUint8 domain[256] = {0}; + TPtr8 cDomain(domain, sizeof(domain)); + TUint8 user[64] = {0}; + TPtr8 cUser(user, sizeof(user)); + TUint8 pass[64] = {0}; + TPtr8 cPass(pass, sizeof(pass)); + + cDomain.Copy(iSettings->Ed_registrar()); + cUser.Copy(iSettings->Ed_user()); + cPass.Copy(iSettings->Ed_password()); + symbian_ua_set_account((char*)domain, (char*)user, (char*)pass, false, false); + + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); + return ETrue; + } + +/** + * Handle the selected event. + * @param aCommand the command id invoked + * @return ETrue if the command was handled, EFalse if not + */ +TBool Csymbian_ua_guiSettingItemListView::HandleCancelMenuItemSelectedL( TInt aCommand ) + { + AppUi()->ActivateLocalViewL(TUid::Uid(ESymbian_ua_guiContainerViewId)); + return ETrue; + } + |