ImagePrint/ImagePrintUI/imageprintapp/inc/cpropertiesboxmodel.h
branchRCL_3
changeset 20 159fc2f68139
parent 17 26673e532f65
child 21 d59c248c9d36
equal deleted inserted replaced
17:26673e532f65 20:159fc2f68139
     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 CPROPERTIESBOXMODEL_H
       
    20 #define CPROPERTIESBOXMODEL_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <bamdesca.h>
       
    24 #include <eiklbo.h>
       
    25 
       
    26 #include "mprintsettings.h"
       
    27 
       
    28 class CImagePrintSettingsContainer;
       
    29 class CImagePrintEngine;
       
    30 
       
    31 const TInt KMaxListName = 128;
       
    32 
       
    33 /**
       
    34  *
       
    35  *  List box model that handles the contents of the list box and launches
       
    36  *  the pop-up dialogs that are used .
       
    37  *
       
    38  */
       
    39 class CPropertiesBoxModel :
       
    40     public CBase,
       
    41     public MEikListBoxObserver,
       
    42     public MDesCArray
       
    43     {
       
    44     public:         //  Constructors and destructors
       
    45 
       
    46         /**
       
    47          *  Two-phase constructor
       
    48          *
       
    49          *  @param aSettings   Print settings
       
    50          *  @return Initialized instance of CPropertiesBoxModel
       
    51          */
       
    52         static CPropertiesBoxModel* NewL( CImagePrintEngine& aEngine,
       
    53 											MPrintSettings* aSettings,
       
    54 											CImagePrintSettingsContainer* aContainer );
       
    55 
       
    56         static CPropertiesBoxModel* NewLC( CImagePrintEngine& aEngine,
       
    57 											MPrintSettings* aSettings,
       
    58 											CImagePrintSettingsContainer* aContainer );
       
    59 
       
    60         /**
       
    61          *  Destructor
       
    62          */
       
    63         virtual ~CPropertiesBoxModel();
       
    64 
       
    65     private:        //  Constructors and destructors
       
    66 
       
    67         /**
       
    68          *  Constructor
       
    69          *
       
    70          *  @param aSettings    Print settings
       
    71          */
       
    72         CPropertiesBoxModel( CImagePrintEngine& aEngine,
       
    73 								MPrintSettings* aSettings,
       
    74 								CImagePrintSettingsContainer* aContainer );
       
    75 
       
    76         /**
       
    77          *  2nd phase constructor
       
    78          */
       
    79         void ConstructL();
       
    80 
       
    81     public:         //  Methods derived from MEikListBoxObserver
       
    82 
       
    83         void HandleListBoxEventL( CEikListBox* aListBox,
       
    84                                   TListBoxEvent aEventType );
       
    85       
       
    86         /**
       
    87          *  Returns number of copies.
       
    88          */
       
    89         TInt NumberOfCopies();
       
    90       
       
    91 
       
    92     private:        //  Methods derived from MDesCArray
       
    93 
       
    94         TInt MdcaCount() const;
       
    95         TPtrC MdcaPoint( TInt aIndex ) const;
       
    96 
       
    97     private:        //  New methods
       
    98 
       
    99         /**
       
   100          *  Returns the index to the capability array from list box array
       
   101          *
       
   102          *  @return Capability array index
       
   103          */
       
   104         TUint CapabilityArrayIndex( TInt aListBoxIndex ) const;
       
   105 
       
   106         /**
       
   107          *  Stores current setting to the engine
       
   108          */
       
   109         void SaveCurrentSelectionL( CBaseCapability &aCapab, CEikListBox* aListBox );
       
   110 
       
   111         /**
       
   112          * Launches list query for default printer
       
   113          *
       
   114          * @return wanted protocol
       
   115          */
       
   116         TInt LaunchDefaultPrinterListL();
       
   117         
       
   118         /**
       
   119          *  Stores number of copies value to the engine
       
   120          *  NOTE: Number of copies value is job based value since IP 6.2
       
   121          */
       
   122         void LaunchNumberOfCopiesDialogL();
       
   123 
       
   124         /**
       
   125          *  Init print settings 
       
   126          */
       
   127 		void InitSettingsL();
       
   128 
       
   129         /**
       
   130          *  Sets DefaultPrinterItem for ListBox 
       
   131          */
       
   132         void SetDefaultPrinterItem() const;
       
   133 
       
   134         /**
       
   135          *  Sets SetNumberOfCopiesItem for ListBox
       
   136          */
       
   137         void SetNumberOfCopiesItem() const;
       
   138 
       
   139         /**
       
   140          *  Sets other capability(template, papersize etc.) for ListBox 
       
   141          */
       
   142         void SetOtherCapability( const TInt &aIndex ) const;
       
   143         
       
   144         /**
       
   145          *  Sets number of copies value for settings
       
   146          */
       
   147         void SetNumberOfCopiesValueL();
       
   148 
       
   149     private:  // Data
       
   150 
       
   151 		CImagePrintEngine& iEngine;
       
   152         MPrintSettings* iSettingsIF;  // use
       
   153         CPrintSettings* iPrintSettings;
       
   154         TInt iCount;
       
   155         TInt iNumberOfCopiesValue;
       
   156         CImagePrintSettingsContainer* iContainer;
       
   157         mutable TBuf<KMaxListName> iBuf;
       
   158 		HBufC* iDefaultPrinter;
       
   159 		HBufC* iNumberOfCopiesText;
       
   160 		HBufC* iMMC;
       
   161         HBufC* iPictBridge;
       
   162     };
       
   163 
       
   164 #endif  //  CPROPERTIESBOXMODEL_H
       
   165 
       
   166 //  End of File