idlehomescreen/nativeuicontroller/inc/aitoolbarrenderer.h
changeset 0 f72a12da539e
child 9 f966699dea19
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Touch Toolbar
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AITOOLBARRENDERER_H
       
    20 #define C_AITOOLBARRENDERER_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <akntoolbarobserver.h>
       
    24 #include "ainativerenderer.h"
       
    25 #include "ainativeuimodel.h"
       
    26 #include "aitoolbarbutton.h"
       
    27 
       
    28 class MAiFwEventHandler;
       
    29 class CAknToolbar;
       
    30 
       
    31 namespace AiNativeUiController
       
    32 {
       
    33 
       
    34     
       
    35 /**
       
    36  *  Toolbar class of Native UI Controller application
       
    37  *
       
    38  *  @lib AiNatiUi
       
    39  */
       
    40 // inheritance order must be this, despite codescanner warnings
       
    41 class CAiToolbarRenderer : public MAknToolbarObserver,
       
    42                            public CAiNativeRenderer
       
    43     {
       
    44 
       
    45     
       
    46 public:   // Constructors and destructor
       
    47 
       
    48     static CAiToolbarRenderer* NewLC( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar);
       
    49 
       
    50     static CAiToolbarRenderer* NewL( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar );
       
    51     
       
    52     ~CAiToolbarRenderer();
       
    53     
       
    54 public:   // from CAiNativeRenderer    
       
    55     
       
    56     void DoPublishL( MAiPropertyExtension& aPlugin,
       
    57 					 TInt aContent,
       
    58 					 const TDesC16& aText,
       
    59 					 TInt aIndex );
       
    60     
       
    61     void DoPublishL( MAiPropertyExtension& aPlugin,
       
    62                      TInt aContent,
       
    63                      const TDesC8& aBuf,
       
    64                      TInt aIndex );
       
    65                      
       
    66     void TransactionCommittedL();
       
    67 
       
    68                      
       
    69 private:  // from MAknToolbarObserver 
       
    70      
       
    71   	void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar );
       
    72   	
       
    73  	void OfferToolbarEventL( TInt aCommand );
       
    74 
       
    75 private:
       
    76 
       
    77     CAiToolbarRenderer( MAiFwEventHandler& aAiFwEventHandler, CAknToolbar& aToolbar );
       
    78 
       
    79     void ConstructL();
       
    80     
       
    81     
       
    82     /**
       
    83      * Get a button with id. If no button exists at the given
       
    84      * id a new button will be created and returned. 
       
    85      *     
       
    86      * Ownership NOT transferred.     
       
    87      */
       
    88     CAiToolbarButton* ButtonL( TInt aShortcutId );
       
    89 
       
    90     
       
    91 private:     // Data
       
    92 
       
    93     /** 
       
    94      * The actual toolbar    
       
    95      */
       
    96 	CAknToolbar& iToolbar;
       
    97 	
       
    98 	/**
       
    99 	 * Handler to send the toolbar events
       
   100 	 */
       
   101  	MAiFwEventHandler& iAiFwEventHandler;
       
   102     
       
   103     /**
       
   104      * Array of buttons. Buttons are owned.
       
   105      */
       
   106     RPointerArray<CAiToolbarButton> iButtons;
       
   107     
       
   108     /**
       
   109      * Have we already committed
       
   110      */
       
   111     TBool iCommitted;
       
   112 
       
   113     /**
       
   114      * Is the toolbar enabled in the cenrep
       
   115      */
       
   116     TBool iToolbarEnabled;
       
   117     };
       
   118     
       
   119 }  // namespace AiNativeUiController
       
   120     
       
   121 #endif  // C_AITOOLBARRENDERER_H
       
   122 
       
   123 // End of File.