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