ImagePrint/ImagePrintUI/imageprintapp/inc/cimageprintappui.h
branchGCC_SURGE
changeset 25 59ea2209bb67
parent 23 08cc4cc059d4
parent 15 a92d00fca574
equal deleted inserted replaced
23:08cc4cc059d4 25:59ea2209bb67
     1 /*
       
     2 * Copyright (c) 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIMAGEPRINTAPPUI_H
       
    20 #define CIMAGEPRINTAPPUI_H
       
    21 
       
    22 #include <eikapp.h>
       
    23 #include <eikdoc.h>
       
    24 #include <e32std.h>
       
    25 #include <coeccntx.h>
       
    26 #include <aknappui.h>
       
    27 #include <aknViewAppUi.h>
       
    28 #include <ErrorUI.h>
       
    29 #include <aknnotewrappers.h>
       
    30 #include <AknWaitNoteWrapper.h>
       
    31 #include <AknProgressDialog.h>
       
    32 #include <e32property.h>
       
    33 #include <data_caging_path_literals.hrh>
       
    34 
       
    35 #include "midleprinteventobserver.h"
       
    36 #include "rimageprintclient.h"
       
    37 #include "muimodeobserver.h"
       
    38 
       
    39 class CAknNavigationDecorator;
       
    40 class CDiscoveryDlgManager;
       
    41 class CImagePrintDoc;
       
    42 class CIMGPPrintDlgManager;
       
    43 class MPrintSettings;
       
    44 class MPrintPreview;
       
    45 class CAknStaticNoteDialog;
       
    46 class MUIMode;
       
    47 
       
    48 const TInt KPrinterNameID( 100 );
       
    49 
       
    50 //  CLASS DEFINITION
       
    51 /**
       
    52  *
       
    53  *  AppUi class
       
    54  *
       
    55  */
       
    56 class CImagePrintAppUi
       
    57     : public CAknViewAppUi,
       
    58       public MUIModeObserver
       
    59      {
       
    60 
       
    61 	public:		// Constructors and destructors
       
    62 
       
    63         /**
       
    64          *  Second phase constructor
       
    65          */
       
    66 		void ConstructL();
       
    67 
       
    68         /**
       
    69          *  Destructor
       
    70          */
       
    71 		virtual ~CImagePrintAppUi();
       
    72 
       
    73 	private:	// Methods derived from CAknViewAppUi base class
       
    74 
       
    75 		void HandleCommandL( TInt aCommand );
       
    76 
       
    77     public: // Methods derived from MUIModeObserver
       
    78         void ChangeViewL( TInt aView );
       
    79         void ExitApplication();
       
    80         
       
    81         // Set text to navipane.
       
    82         void SetNavipaneTextL( const TInt aCopiesOfImage, HBufC* aPaperSize = NULL );
       
    83         
       
    84     public:    // New methods
       
    85 
       
    86         /**
       
    87          * Method is used to forward the selected images to engine.
       
    88          *
       
    89          * @param aFileArray, array that contains the selected images.
       
    90          */
       
    91         void SetImageArrayL( CDesCArrayFlat* aFileArray );
       
    92 
       
    93         /**
       
    94          * Method returns the Dosument class od this application
       
    95          *
       
    96          * @return CimagePrintDoc document class
       
    97          */
       
    98         CImagePrintDoc* GetDocument();
       
    99 
       
   100         /**
       
   101          * Method returns the image array
       
   102          *
       
   103          * @return CDesCArrayFlat array that contains the selected images
       
   104          */
       
   105         CDesCArrayFlat* GetImageArray();
       
   106 
       
   107         /**
       
   108          * Launches application help
       
   109          *
       
   110          * @param aHelptext help text context
       
   111          */
       
   112         void LaunchHelpApplicationL( const TDesC& aHelpText );
       
   113 
       
   114         /**
       
   115          * Gets the AIW state (iAiwState)
       
   116          *
       
   117          */
       
   118         TInt GetAiwState();
       
   119 
       
   120         /**
       
   121          * Returns UID of the application
       
   122          *
       
   123          * @return UID
       
   124          */
       
   125          TInt GetApplicationUID();
       
   126 
       
   127         /**
       
   128          * Returns UID for the settings view
       
   129          *
       
   130          * @return UID
       
   131          */
       
   132          TUid GetSettingsViewUid();
       
   133 
       
   134          /**
       
   135          * Returns AIW state.
       
   136          *
       
   137          * ETrue = Application is launched via AIW
       
   138          * EFalse = Application is launched from active idle.
       
   139          *
       
   140          * @return AIW state.
       
   141          */
       
   142         TBool AiwState();
       
   143 
       
   144         /**
       
   145          * Check orientation mode
       
   146          *
       
   147          * @return ETrue of orientation is portrait, otherwise EFalse
       
   148          */
       
   149         TBool OrientationPortrait();
       
   150 
       
   151         /**
       
   152          * Check whether the operating resolution is QVGA
       
   153          *
       
   154          * @return ETrue if operating resolution is QVGA, otherwise EFalse
       
   155          */
       
   156         TBool QVGAMode();
       
   157 
       
   158         /**
       
   159          * Gets the album call index
       
   160          *
       
   161          * @return album call index
       
   162          */
       
   163         TInt GetAlbumCall();
       
   164 
       
   165         /**
       
   166          * Sets the album call index
       
   167          *
       
   168          * @param aAlbumCall album call index
       
   169          */
       
   170         void SetAlbumCall(TInt aAlbumCall);
       
   171 
       
   172         /**
       
   173          * Sets the validity status of images
       
   174          *
       
   175          * @param aStatus ETrue if images are valid, otherwise EFalse
       
   176          */
       
   177         void SetValidImagesStatus( TBool aStatus );
       
   178 
       
   179         /**
       
   180          * callback for printer search in aiw mode
       
   181          *
       
   182          * @param aObj callback object
       
   183          *
       
   184          * @return status of the call
       
   185          */
       
   186         static TInt SearchDefaultPrinterCbL( TAny* aObj );
       
   187 
       
   188     private: // New methods
       
   189 
       
   190         CDesCArrayFlat* GetImagesFromAiwProviderL();
       
   191 
       
   192     private:    // Data
       
   193 
       
   194         // Used for navigation pane text
       
   195         CAknNavigationDecorator* iNaviDecorator;
       
   196 
       
   197         // Offset for engine's resource file
       
   198         TInt iResourceOffset;
       
   199 
       
   200         //Document class
       
   201         CImagePrintDoc* iDoc;
       
   202 
       
   203         CIMGPPrintDlgManager* iPrintDlgManager; // use
       
   204 
       
   205         // Printed image files
       
   206         CDesCArrayFlat* iFiles;
       
   207 
       
   208         // UID of the selected printer
       
   209         TInt iPrinterUID;
       
   210 
       
   211         // Information about the state of usb discovery
       
   212         TBool iUSBDiscoveryOngoing;
       
   213 
       
   214         // Is usb printer connected to phone
       
   215         TBool iUSBPrinter;
       
   216 
       
   217         // USB connect/disconnect note
       
   218         CAknProgressDialog* iUSBConnectionWaitNote;
       
   219 
       
   220         // Is usb device connected
       
   221         TBool iUsbConnected;
       
   222 
       
   223         // Is USB printer selected
       
   224         TBool iUSBPrinterSelected;
       
   225 
       
   226         // For AIW calls;
       
   227         TInt iAiwState;
       
   228 
       
   229         RProperty iAiwCall;
       
   230 
       
   231         TBool iApplicationStarting;
       
   232 
       
   233         TBool iBTDiscovery;
       
   234 
       
   235 		RImagePrintClient iImagePrintClient;
       
   236 
       
   237         TInt iAlbumCall;
       
   238 
       
   239         TBool iNotifyDone;
       
   240 
       
   241         // ETrue when exiting the application in AIW mode
       
   242         TBool iExiting;
       
   243 
       
   244         TBool iFullDiscovery;
       
   245 
       
   246         TBool iDisconnectOnce;
       
   247 
       
   248         TBool iUsbWanted;
       
   249 
       
   250         TBool iValidImages;
       
   251 
       
   252         MUIMode* iUIMode;
       
   253 
       
   254         // idle object for performing search in aiw mode, owned
       
   255         CIdle* iIdleSearch;
       
   256 
       
   257     };
       
   258 
       
   259 #endif  // CIMAGEPRINTAPPUI_H
       
   260 
       
   261 //  End of File