www.pudn.com > S60_Platform_Bluetooth_OBEX_Example.rar > btobjectexchangeappui.h


/* Copyright (c) 2004, Nokia. All rights reserved */ 
 
 
#ifndef __BTOBJECTEXCHANGE_APPUI_H__ 
#define __BTOBJECTEXCHANGE_APPUI_H__ 
 
// INCLUDES 
#include  
 
// FORWARD DECLARATIONS 
class CBTObjectExchangeAppView; 
class CObjectExchangeClient; 
class CObjectExchangeServer; 
class CDocumentHandler; 
#ifdef __SERIES60_3X__ 
class CSendUi; 
#else 
class CSendAppUi; 
#endif 
 
//CONSTANTS 
_LIT(KTitle, "BT OBEX Example"); 
_LIT(KCanceled,"Canceled"); 
_LIT(KSenduiError,"Send UI error "); 
_LIT(KSenduiOk,"Sent via Send UI"); 
 
/** 
* CBTObjectExchangeAppUi 
* An instance of class CBTObjectExchangeAppUi is the UserInterface part 
* of the AVKON application framework for the BTObjectExchange 
* example application. 
*/ 
class CBTObjectExchangeAppUi : public CAknAppUi 
    { 
    public: // Constructors and destructor 
 
        /** 
        * ConstructL() 
        * Perform the second phase construction of a 
        * CBTObjectExchangeAppUi object. This needs to be public 
        * due to the way the framework constructs the AppUi 
        */ 
        void ConstructL(); 
 
        /** 
        * CBTObjectExchangeAppUi() 
        * Perform the first phase of two phase construction. This needs to be 
        * public due to the way the framework constructs the AppUi 
        */ 
        CBTObjectExchangeAppUi(); 
 
        /** 
        * ~CBTObjectExchangeAppUi() 
        * Destroy the object and release all memory objects 
        */ 
        virtual ~CBTObjectExchangeAppUi(); 
 
    public: // from CEikAppUi 
 
        /** 
        * DynInitMenuPaneL() 
        * Determine which operations are available and set menu accordingly 
        * @param aResourceId resource ID of the menu pane to be initialised 
        * @param aMenuPane the in-memory representation of the menu pane 
        */ 
        void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); 
 
        /** 
        * HandleCommandL() 
        * Handle user menu selections 
        * @param aCommand the enumerated code for the option selected 
        */ 
        void HandleCommandL( TInt aCommand ); 
 
        /** 
        * HandleResourceChangeL 
        * Handles scalable ui 
        * @param aType the resource change type 
        */ 
        void HandleResourceChangeL(TInt aType); 
 
    public: 
        /** 
        * AskFileL() 
        * Asks for a file name 
        * @param aFileName the given file name 
        * @return true if user gave a file name, false if canceled 
        */ 
        TBool AskFileL(TFileName& aFileName); 
 
        /** 
        * ShowMessageL() 
        * Shows a message in a dialog 
        * @param aMsg the message to show 
        */ 
        void ShowMessageL( const TDesC& aMsg ); 
 
        /** 
        * HandleJoystickPressL() 
        * Called from view when joystick is pressed. The line of text 
        * in the listbox is given here. 
        * @param aLine the line of text 
        * @return true if the line contained a file name 
        **/ 
        TBool HandleJoystickPressL(TDesC& aLine); 
 
        /** 
        * TurnBtOnL() 
        * Asks the user to turn on BT if it is off. 
        */ 
        void TurnBtOnL(); 
         
        /** 
        * Asks for a file (in 2nd and 3rd edition) and sends it via 
        * selected bearer using Send UI API. In 1st edition the  
        * file selection dialogs are not working so the file is hardcoded. 
        * 
        * The aCommand is the selected command id  
        * (selected bearer from the Send cascade menu). Needed in 1st/2nd edition 
        * when calling CSendAppUi::CreateAndSendMessageL  
        */  
        void SendFileViaSendUiL(TInt aCommand); 
 
    private:    // data 
 
        /** 
        * iAppView the application view 
        * Owned by CBTObjectExchangeAppUi 
        */ 
        CBTObjectExchangeAppView* iAppView; 
 
        /** 
        * iClient the client owned by this user interface 
        * Owned by CBTObjectExchangeAppUi 
        */ 
        CObjectExchangeClient* iClient; 
 
        /** 
        * iServer the server owned by this user interface 
        * Owned by CBTObjectExchangeAppUi 
        */ 
        CObjectExchangeServer* iServer; 
 
        /** 
        * iBtAvailable, ETrue if an SDP session can be opened, EFalse otherwise. 
        */ 
        TBool iBtAvailable; 
 
        /** 
        *iDocHandler, Document Handler object used for file launching 
        */ 
        CDocumentHandler* iDocHandler; 
 
        //Introduce the Send UI object 
        #ifdef __SERIES60_3X__  
        CSendUi* iSendUi; 
        #else 
        CSendAppUi* iSendUi; 
        #endif 
    }; 
 
#endif // __BTOBJECTEXCHANGE_APPUI_H__ 
 
// End of File