meetingrequest/mrbcplugin/inc/cmrbcpluginresourcereader.h
branchRCL_3
changeset 12 4ce476e64c59
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
       
     1 /*
       
     2 * Copyright (c) 2008 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: MBUtils ECOM definition
       
    15 *
       
    16 */
       
    17 #ifndef C_MRBCPLUGINRESOURCEREADER_H
       
    18 #define C_MRBCPLUGINRESOURCEREADER_H
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <barsc.h>
       
    22 #include <babitflags.h>
       
    23 #include "tmrbcplugincommand.h"
       
    24 #include "esmrdef.h"
       
    25 
       
    26 class CMRBCEventPlugin;
       
    27 class MCalenServices;
       
    28 
       
    29 /**
       
    30  * CMRBCPluginResourceReader reads BC Plug-In resource file
       
    31  * information.
       
    32  * @see mrbcplugin.rh
       
    33  */
       
    34 NONSHARABLE_CLASS( CMRBCPluginResourceReader ) : public CBase
       
    35     {
       
    36 public: // Constrction and destruction
       
    37     
       
    38     /**
       
    39      * Creates and initializes new CMRBCPluginResourceReader object.
       
    40      * @param aCalenServices Reference to calendar services
       
    41      */
       
    42     static CMRBCPluginResourceReader* NewL(
       
    43             MCalenServices& aCalenServices );
       
    44     
       
    45     /**
       
    46      * C++ destructor
       
    47      */
       
    48     ~CMRBCPluginResourceReader();
       
    49     
       
    50 public: // Interface 
       
    51     /**
       
    52      * Reads resource information from file.
       
    53      * @param aResourceFile
       
    54      */
       
    55     void ReadFromResourceFileL(
       
    56             TUid aUid,
       
    57             const TDesC& aResourceFile );
       
    58     
       
    59     /**
       
    60      * Version information
       
    61      * @return Version information
       
    62      */
       
    63     TVersion Version() const;
       
    64     
       
    65     /**
       
    66      * Tests if BC plugin resource supports specified type
       
    67      * @param aEventType Specifies event type
       
    68      * @return ETrue if event type is supported, EFalse otherwise
       
    69      */
       
    70     TBool SupportsType( TBCPluginEventType aEventType ) const;
       
    71     
       
    72     /**
       
    73      * Tests if specified command is supported
       
    74      * @param aCommand Specifies the command
       
    75      * @return ETrue if command is supported, EFalse otherwise
       
    76      */
       
    77     TBool SupportsCommand( TInt aCommand ) const;
       
    78     
       
    79     /**
       
    80      * Fetches command from resource.
       
    81      * @param aCommand Command to be executed
       
    82      * @param aPluginCommand On return contains the fecthed plug-in command
       
    83      * @return KErrNone if command is found, KErrNotFound otherwise 
       
    84      */
       
    85     TInt Command( 
       
    86             TInt aCommand, 
       
    87             TMRBCPluginCommand& aPluginCommand) const; 
       
    88     /**
       
    89      * Fetches plugin implemenation UID
       
    90      * @return plugin implemenation UID
       
    91      */
       
    92     TUid PluginImplUid() const;
       
    93     
       
    94     /**
       
    95      * Fetches the plugin implemenation.
       
    96      * @return Plugin implementation
       
    97      */
       
    98     CMRBCEventPlugin& PluginL();
       
    99     
       
   100 private: // Implementation    
       
   101     CMRBCPluginResourceReader(
       
   102             MCalenServices& aCalenServices );
       
   103     void ConstructL();
       
   104     
       
   105 private: // Data
       
   106     /// Ref: Calender services
       
   107     MCalenServices& iCalenServices;
       
   108     /// Own: Resource reader
       
   109     RResourceFile iBCPluginResourceFile;
       
   110     /// Own: Plugin implementation UID
       
   111     TUid iPluginImplementationUid;
       
   112     /// Own: Resource file offset
       
   113     TInt iOffset;    
       
   114     /// Own: Version information
       
   115     TVersion iVersion;
       
   116     /// Own: Supported event types
       
   117     TBitFlags32 iSupportedEventTypes;    
       
   118     /// Own: Command IDs
       
   119     RArray<TMRBCPluginCommand> iPluginCommands;
       
   120     /// Own: Plugin implementation
       
   121     CMRBCEventPlugin* iPlugin;
       
   122     };
       
   123 
       
   124 #endif // C_MRBCPLUGINRESOURCEREADER_H
       
   125 
       
   126 // EOF