DirectPrint/DirectPrintApp/inc/directprintappappui.h
branchRCL_3
changeset 12 613a5ff70823
child 15 2275db202402
equal deleted inserted replaced
8:3f1fec088555 12:613a5ff70823
       
     1 /*
       
     2 * Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "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 * Kanrikogaku Kenkyusho, Ltd. - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * {Description of the file}
       
    16 *
       
    17 */
       
    18 
       
    19 // Protection against nested includes
       
    20 #ifndef __DIRECTPRINTAPPAPPUI_H__
       
    21 #define __DIRECTPRINTAPPAPPUI_H__
       
    22 
       
    23 // System includes
       
    24 #include <aknviewappui.h>
       
    25 #include <aknnavide.h>
       
    26 #include <AknTabObserver.h> 
       
    27 #include <e32property.h>
       
    28 #include <xmlengdocument.h>				// RXmlEngDocument
       
    29 #include <xmlengdomparser.h>			// RXmlEngDOMParser
       
    30 #include <xmlengdomimplementation.h>	// RXmlEngDOMImplementation
       
    31 
       
    32 // User includes
       
    33 #include "DirectPrintEngineObserver.h"
       
    34 #include "DirectPrintBearerMngObserver.h"
       
    35 
       
    36 // Forward declarations
       
    37 class CDirectPrintMainView;
       
    38 class CDirectPrintAppDocument;
       
    39 class CDirectPrintEngine;
       
    40 class CDirectPrintBearerMgr;
       
    41 class CDirectPrintUiPluginMgr;
       
    42 
       
    43 // Class declaration
       
    44 class CDirectPrintAppAppUi : public CAknViewAppUi,
       
    45 							 public MAknTabObserver,
       
    46 							 public MDirectPrintEngineObserver,
       
    47 							 public MDirectPrintBearerMngObserver
       
    48 	{
       
    49 public: // Constructors and destructor
       
    50 	CDirectPrintAppAppUi();
       
    51 	virtual ~CDirectPrintAppAppUi();
       
    52 	void ConstructL();
       
    53 
       
    54 private:
       
    55 	// Functions from base classes
       
    56 
       
    57 	/**
       
    58 	 * From CEikAppUi, HandleCommandL.
       
    59 	 * Takes care of command handling.
       
    60 	 * @param aCommand Command to be handled.
       
    61 	 */
       
    62 	void HandleCommandL( TInt aCommand );
       
    63 
       
    64 	/**
       
    65 	 * From CEikAppUi, HandleResourceChangeL.
       
    66 	 * Handles a change to the application's resources.
       
    67 	 * @param aType Type of resources.
       
    68 	 */
       
    69 	void HandleResourceChangeL( TInt aType );
       
    70 
       
    71 public: // from MAknTabObserver
       
    72 	/**
       
    73 	 * From MAknTabObserver, TabChangedL.
       
    74 	 * Handles a change to the tabs.
       
    75 	 * @param aIndex Index of tabs.
       
    76 	 */
       
    77 	void TabChangedL(TInt aIndex);
       
    78 
       
    79 public: // from MDirectPrintEngineObserver
       
    80 	/**
       
    81 	 * From MDirectPrintEngineObserver, HandlePrintEventL.
       
    82 	 * Handles user events.
       
    83 	 * @param aEvent The ID of the event.
       
    84 	 * @param aError The ID of the error.
       
    85 	 * @param aParam Parameter.
       
    86 	 */
       
    87 	void HandlePrintEventL(TDirectPrintEngineEvents aEvent,
       
    88 						   TInt aError, 
       
    89 						   const TDesC& aParam);
       
    90 
       
    91 public: // from MDirectPrintBearerMngObserver
       
    92 	/**
       
    93 	 * From MDirectPrintBearerMngObserver, HandleBearerMngEventL.
       
    94 	 * Handles user events.
       
    95 	 * @param aEvent The ID of the event.
       
    96 	 * @param aError Error code.
       
    97 	 * @param aParam Parameter.
       
    98 	 */
       
    99 	void HandleBearerMngEventL(TDirectPrintBearerMngEvents aEvent,
       
   100 						   TInt aError, 
       
   101 						   const TDesC& aParam);
       
   102 
       
   103 	/**
       
   104 	 * From MDirectPrintBearerMngObserver, PrintJobProgressEvent.
       
   105 	 * Handles user events.
       
   106 	 * @param aStatus The ID of the status.
       
   107 	 * @param aPercentCompletion Percentage of progress.
       
   108 	 * @param aJobStateCode The ID of job states.
       
   109 	 */
       
   110 	void PrintJobProgressEvent( TInt aStatus, 
       
   111 							TInt aPercentCompletion, 
       
   112 							TInt aJobStateCode );
       
   113 							
       
   114 
       
   115 	/**
       
   116 	 * From MDirectPrintBearerMngObserver, PrintJobErrorEvent.
       
   117 	 * Handles user events.
       
   118 	 * @param aError The ID of the error.
       
   119 	 * @param aErrorStringCode The ID of error strings.
       
   120 	 */
       
   121 	void PrintJobErrorEvent( TInt aError, 
       
   122 							TInt aErrorStringCode );
       
   123 							
       
   124 
       
   125 	/**
       
   126 	 * From MDirectPrintBearerMngObserver, PrinterStatusEvent.
       
   127 	 * Handles user events.
       
   128 	 * @param aError The ID of the error.
       
   129 	 * @param aErrorStringCode The ID of error strings.
       
   130 	 */
       
   131 	void PrinterStatusEvent( TInt aError, 
       
   132 							TInt aErrorStringCode );
       
   133 
       
   134 	/**
       
   135 	 * From MDirectPrintBearerMngObserver, PreviewImageEvent.
       
   136 	 * Handles user events.
       
   137 	 * @param aFsBitmapHandle The Handle of the bitmap.
       
   138 	 */
       
   139 	void PreviewImageEvent( TInt aFsBitmapHandle );
       
   140 
       
   141 	/**
       
   142 	 * From MDirectPrintBearerMngObserver, ShowMessageL.
       
   143 	 * Show messages.
       
   144 	 * @param aMsgLine1Code The ID of message.
       
   145 	 * @param aMsgLine2Code The ID of message.
       
   146 	 */
       
   147 	void ShowMessageL( TInt aMsgLine1Code, 
       
   148 							TInt aMsgLine2Code );
       
   149 
       
   150 	/**
       
   151 	 * From MDirectPrintBearerMngObserver, AskYesNoQuestionL.
       
   152 	 * Show Yes/No question.
       
   153 	 * @param aMsgLine1Code The ID of message.
       
   154 	 * @param aMsgLine2Code The ID of message.
       
   155 	 * @return ETrue is Yes. EFalse is No.
       
   156 	 */
       
   157 	TBool AskYesNoQuestionL( TInt aMsgLine1Code, 
       
   158 							TInt aMsgLine2Code );
       
   159 
       
   160 	/**
       
   161 	 * From MDirectPrintBearerMngObserver, AskForInputL.
       
   162 	 * input.
       
   163 	 * @param aMsgLine1Code The ID of message.
       
   164 	 * @param aMsgLine2Code The ID of message.
       
   165 	 * @return Inputed strings.
       
   166 	 */
       
   167 	const TDesC& AskForInputL( TInt aMsgLine1Code, 
       
   168 							TInt aMsgLine2Code );
       
   169 
       
   170 public:
       
   171 	/**
       
   172 	 * engine object.
       
   173 	 * 
       
   174 	 * @return Pointer to a engine object.
       
   175 	 */
       
   176 	inline CDirectPrintEngine* Engine() {return iEngine;}
       
   177 
       
   178 	/**
       
   179 	 * document object.
       
   180 	 * 
       
   181 	 * @return Pointer to a document object.
       
   182 	 */
       
   183 	inline CDirectPrintAppDocument* Doc() {return iDoc;}
       
   184 
       
   185 	/**
       
   186 	 * Plugin manager object.
       
   187 	 * 
       
   188 	 * @return Reference to a plugin manager object.
       
   189 	 */
       
   190 	inline CDirectPrintUiPluginMgr& PluginMgr() {return *iPluginMgr;}
       
   191 
       
   192 	/**
       
   193 	 * Bearer manager object.
       
   194 	 * 
       
   195 	 * @return Pointer to a bearer manager object.
       
   196 	 */
       
   197 	inline CDirectPrintBearerMgr* BearerMgr() {return iBearerMgr;}
       
   198 
       
   199 private:
       
   200 	void MakeNaviPaneVisibleL(TBool aVisible);
       
   201 	void MakeStatusPaneVisible(TBool aVisible);
       
   202 
       
   203 	void InitializeViewsL();
       
   204 	void LoadParamL();
       
   205 	void GetParamFromAiwProviderL();
       
   206 
       
   207 	void InitializeEngineL();
       
   208 	void InitializeBearerMngL();
       
   209 	void InitializePluginMgrL();
       
   210 
       
   211 private: // Data
       
   212 	// Used for navigation pane text
       
   213 	CAknNavigationDecorator* iNaviDecorator;
       
   214 
       
   215 	// Document class
       
   216 	CDirectPrintAppDocument* iDoc;
       
   217 
       
   218 	// previous view id
       
   219 	TUid iBackViewUid;
       
   220 
       
   221 	// For AIW calls;
       
   222 	TInt iAiwState;
       
   223 
       
   224 	// publish/subscribe of aiw print
       
   225 	RProperty iAiwCall;
       
   226 
       
   227 	// print engine
       
   228 	CDirectPrintEngine* iEngine;
       
   229 	
       
   230 	// bearer manager
       
   231 	CDirectPrintBearerMgr* iBearerMgr;
       
   232 
       
   233 	// param xml object
       
   234 	RXmlEngDocument iXmlEngDoc;
       
   235     RXmlEngDOMImplementation iXmlDomImpl;
       
   236     RXmlEngDOMParser iXmlParser;
       
   237 
       
   238 	HBufC8*	iXmlParam;
       
   239 
       
   240 	CDirectPrintUiPluginMgr* iPluginMgr;
       
   241 	};
       
   242 
       
   243 #endif // __DIRECTPRINTAPPAPPUI_H__
       
   244 
       
   245 // End of File
       
   246