calendarui/customisationmanager/inc/calenviewinfo.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 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:   Calendar controller
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CALENVIEWINFO_H
       
    20 #define CALENVIEWINFO_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <calenview.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 // CLASS DEFINITIONS
       
    29 
       
    30 /**
       
    31  * Wrapper around views. This lets us quickly get info on views.
       
    32  * When accessed through general settings, native views won't be
       
    33  * constructed so their iView pointer will be NULL.
       
    34  */
       
    35 class CCalenViewInfo : public CBase
       
    36     {
       
    37     public:  // Construction and destruction
       
    38         IMPORT_C static CCalenViewInfo* NewL( TUid aViewUid,
       
    39                                               TUid aPluginUid,
       
    40                                               const TDesC& aMenuName,
       
    41                                               const TDesC& aSettingsName,
       
    42                                               CCalenView::TCyclePosition aCyclePos );
       
    43         virtual ~CCalenViewInfo();
       
    44 
       
    45     public:  // New functions
       
    46         /**
       
    47          * UID of the view.
       
    48          */
       
    49         IMPORT_C TUid ViewUid() const;
       
    50 
       
    51         /**
       
    52          * UID of the plugin.
       
    53          */
       
    54         IMPORT_C TUid PluginUid() const;
       
    55 
       
    56         /**
       
    57          * Localised view name, as appears in e.g. view cycle menu.
       
    58          */
       
    59         IMPORT_C const TDesC& MenuName() const;
       
    60 
       
    61         /**
       
    62          * Localised view name, as appears in default view settings page.
       
    63          */
       
    64         IMPORT_C const TDesC& SettingsName() const;
       
    65 
       
    66         /**
       
    67          * Position the view would like to go in view cycling.
       
    68          */
       
    69         IMPORT_C CCalenView::TCyclePosition CyclePosition() const;
       
    70         
       
    71         /** 
       
    72          * Is the view hidden?
       
    73          */
       
    74          IMPORT_C TBool Hidden() const;
       
    75          
       
    76          /**
       
    77           * Hide the view from the view cycle list
       
    78           */
       
    79           IMPORT_C void Hide( TBool aHide );
       
    80         
       
    81     public: 
       
    82         /**
       
    83          * Compares two views based upon their view cycle position
       
    84          * used for sorting CCalenViewInfo arrays.
       
    85          */
       
    86         IMPORT_C static TInt CyclePositionComparison( 
       
    87                                             const CCalenViewInfo& aFirstView,
       
    88                                             const CCalenViewInfo& aSecondView );
       
    89                                      
       
    90          /**
       
    91          * Matches a CCalenViewInfo object with its plugin uid.
       
    92          */
       
    93         IMPORT_C static TBool ViewPluginIdentifier( const TUid* aUid, 
       
    94                                              const CCalenViewInfo& aArrayItem );
       
    95          
       
    96         /** 
       
    97          * Matches a CCalenViewInfo object with its view Uid
       
    98          */                                    
       
    99         IMPORT_C static TBool ViewInfoIdentifier( const TUid* aUid,
       
   100                                             const CCalenViewInfo& aArrayItem );
       
   101 
       
   102     private:  // Construction and destruction
       
   103         CCalenViewInfo( TUid aViewUid,
       
   104                         TUid aPluginUid,
       
   105                         CCalenView::TCyclePosition aCyclePos );
       
   106 
       
   107         void ConstructL( const TDesC& aMenuName,
       
   108                          const TDesC& aSettingsName );
       
   109 
       
   110     private:  // Data
       
   111         TUid                        iViewUid;     // View uid.
       
   112         TUid                        iPluginUid;   // Plugin uid.
       
   113         HBufC*                      iMenuName;    // Localised name for view cycle menu. Owned.
       
   114         HBufC*                      iSettingsName;// Localised name for default view setting. Owned.
       
   115         CCalenView::TCyclePosition  iCyclePos;    // Cycle position.
       
   116         TBool                       iHidden;      // Has the view been hidden
       
   117     };
       
   118 
       
   119 #endif // CALENVIEWINFO_H
       
   120 
       
   121 // End of file