pkiutilities/CertmanUi/INC/CertmanuicontainerPersonal.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003-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:   Declaration of the CCertManUIContainerPersonal class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef  CERTMANUICONTAINERPERSONAL_H
       
    20 #define  CERTMANUICONTAINERPERSONAL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include "CertmanuiviewPersonal.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CAknIconArray;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 /**
       
    30 *  CCertManUIContainerPersonal container control class.
       
    31 *
       
    32 *  @lib certmanui.lib
       
    33 */
       
    34 NONSHARABLE_CLASS( CCertManUIContainerPersonal ):
       
    35     public CCoeControl, public MCoeControlObserver, public MEikListBoxObserver
       
    36     {
       
    37 
       
    38     /**
       
    39     * Container personal needs to get access to CertManUIViewPersonal's DoActivateL
       
    40     */
       
    41     friend void CCertManUIViewPersonal::DoActivateL( const TVwsViewId&, TUid, const TDesC8& );
       
    42 
       
    43     public: // functions
       
    44 
       
    45         /**
       
    46         * Overrided Default constructor
       
    47         */
       
    48         CCertManUIContainerPersonal( CCertManUIViewPersonal& aParent, CCertManUIKeeper& aKeeper );
       
    49 
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         ~CCertManUIContainerPersonal();
       
    54 
       
    55         /**
       
    56         * Change focus
       
    57         */
       
    58         void FocusChanged( TDrawNow aDrawNow );
       
    59 
       
    60         /**
       
    61         * Draws listbox, fetches graphic icons for markable list
       
    62         */
       
    63         void DrawListBoxL( TInt aCurrentPosition, TInt aTopItem );
       
    64 
       
    65         /**
       
    66         * Gets list of certificates from CertManAPI, displays them,
       
    67         * sets No label text to them if their names are empty
       
    68         */
       
    69         void UpdateListBoxL( TInt& aCurrentPosition, TInt& aTopItem );
       
    70 
       
    71         /**
       
    72         * Handles listbox events
       
    73         */
       
    74         void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
    75 
       
    76         /**
       
    77         * Handles resource change
       
    78         */
       
    79         void HandleResourceChange(TInt aType);
       
    80 
       
    81     public: // data
       
    82 
       
    83         /**
       
    84         * To handle listbox
       
    85         * Type column for making the list markable
       
    86         * Cannot be private because CertManUIViewPersonal uses it
       
    87         */
       
    88         CEikColumnListBox*  iListBox;
       
    89 
       
    90         /**
       
    91         * To get hold of ViewPersonal
       
    92         */
       
    93         CCertManUIViewPersonal&   iParent;
       
    94 
       
    95         /**
       
    96         * To get hold of CertManUIKeeper
       
    97         */
       
    98         CCertManUIKeeper&   iKeeper;
       
    99 
       
   100         /**
       
   101         * To store the list item count
       
   102         */
       
   103         TInt    iListItemCount;
       
   104 
       
   105         /**
       
   106         * To store certificate entries
       
   107         */
       
   108         CArrayPtrFlat<CCrCertEntry>*    iEntriesPersonal;
       
   109 
       
   110     private: // functions
       
   111 
       
   112         /**
       
   113         * Default constructor
       
   114         */
       
   115         CCertManUIContainerPersonal();
       
   116 
       
   117         /**
       
   118         * EPOC default constructor.
       
   119         * @param aRect Frame rectangle for container.
       
   120         */
       
   121         void ConstructL( const TRect& aRect, TInt aCurrentPosition, TInt aTopItem );
       
   122 
       
   123         /**
       
   124         * Creates listbox, sets empty listbox text
       
   125         */
       
   126         void CreateListBoxL();
       
   127 
       
   128         /**
       
   129         * From CoeControl,SizeChanged.
       
   130         */
       
   131         void SizeChanged();
       
   132 
       
   133         /**
       
   134         * From CoeControl,CountComponentControls.
       
   135         */
       
   136         TInt CountComponentControls() const;
       
   137 
       
   138         /**
       
   139         * From CCoeControl,ComponentControl.
       
   140         */
       
   141         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   142 
       
   143         /**
       
   144         * From CCoeControl,Draw.
       
   145         */
       
   146         void Draw( const TRect& aRect ) const;
       
   147 
       
   148         /**
       
   149         * Handles control events
       
   150         * Cannot be changed to non-leaving function.
       
   151         * L-function is required by the class definition, even if empty.
       
   152         */
       
   153         void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
       
   154 
       
   155         /**
       
   156         * Handles the key events OK button, arrow keys, delete key.
       
   157         * OK button functionality is different depending on the number of marked items
       
   158         * in the list; zero marked -> show details view, one or more marked -> show
       
   159         * OKOptions list, list empty -> OK inactive.
       
   160         * Delete active only if list not empty.
       
   161         */
       
   162         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   163 
       
   164         /**
       
   165         * Create the iconarray. Derived classes please don't forget that the
       
   166         * 0th icon must be the markable listbox's mark icon.
       
   167         * @return The created iconarray. Owner is the caller.
       
   168         */
       
   169         CAknIconArray* CreateIconArrayL() const;
       
   170 
       
   171         /**
       
   172         * Get resource id for the iconarray.
       
   173         * @return The resource id for the iconarray.
       
   174         */
       
   175         TInt IconArrayResourceId() const;
       
   176 
       
   177         /**
       
   178         * This function is called when Help application is launched.
       
   179         * (other items were commented in a header).
       
   180         */
       
   181     void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   182 
       
   183   protected: //data
       
   184 
       
   185         /**
       
   186         * If ETrue, OK-Options menu is shown instead of normal Options menu.
       
   187         */
       
   188         TBool   iShowOkOptions;
       
   189 
       
   190     private: //data
       
   191 
       
   192         /**
       
   193         * Icon handler (this creates icons and calculates icon indexes).
       
   194         */
       
   195         const CCertManUIContainerPersonal* iIconHandler;
       
   196     };
       
   197 
       
   198 #endif // CERTMANUICONTAINERPERSONAL_H
       
   199 
       
   200 // End of File