classicui_pub/toolbar_api/tsrc/inc/testsdktoolbarcontrol.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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:  test AknToolbar.h,akntoolbarextension.h and AknToolbarObserver.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_TESTSDKTOOLBARCONTROL_H
       
    20 #define C_TESTSDKTOOLBARCONTROL_H
       
    21 
       
    22 #include <coecntrl.h>
       
    23 #include <akntoolbar.h>
       
    24 #include <akntoolbarobserver.h>
       
    25 
       
    26 /**
       
    27  *  CTestToolbarControl is used to add setting page control in its window
       
    28  */
       
    29 class CTestToolbarControl : public CCoeControl,
       
    30                             public MAknToolbarObserver
       
    31     {
       
    32 public: //constructor and destructor
       
    33     
       
    34     
       
    35     /**
       
    36      * Constructor.
       
    37      */
       
    38     CTestToolbarControl();
       
    39     
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      */
       
    43     static CTestToolbarControl* NewL();
       
    44     
       
    45     /**
       
    46      * Destructor.
       
    47      */
       
    48     ~CTestToolbarControl();
       
    49 
       
    50 public: // from MAknToolbarObserver class
       
    51     
       
    52     /**
       
    53     * Handles toolbar events for a certain toolbar item.
       
    54     * @param aCommand The command ID of some toolbar item.
       
    55     */
       
    56     virtual void OfferToolbarEventL( TInt aCommand );
       
    57     
       
    58     /**
       
    59      * Should be used to set the properties of some toolbar components 
       
    60      * before it is drawn.
       
    61      * @param aResourceId The resource ID for particular toolbar
       
    62      * @param aToolbar The toolbar object pointer
       
    63      */
       
    64     void DoDynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar );
       
    65     
       
    66     /**
       
    67      * from MAknToolbarObserver
       
    68      */
       
    69     TInt DoMAknToolbarObserver_Reserved_1();
       
    70 
       
    71     /**
       
    72      * from MAknToolbarObserver
       
    73      */
       
    74     TInt DoMAknToolbarObserver_Reserved_2();
       
    75    
       
    76 private: // constructor
       
    77     
       
    78     /**
       
    79      * By default Symbian 2nd phase constructor is private.
       
    80      */
       
    81     void ConstructL();
       
    82     
       
    83 private: // from CCoeControl class
       
    84     
       
    85     /**
       
    86      * Receive key events.
       
    87      */
       
    88     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
    89     
       
    90     /**
       
    91      * Draw control.
       
    92      */
       
    93     void Draw(const TRect& aRect) const;
       
    94     
       
    95     /**
       
    96      * Return number of controls in its window.
       
    97      */
       
    98     TInt CountComponentControls() const;
       
    99     
       
   100     /**
       
   101      * Controls in its window.
       
   102      */
       
   103     CCoeControl* ComponentControl(TInt aIndex) const;
       
   104     
       
   105     /**
       
   106      * Resize screen.
       
   107      */
       
   108     void SizeChanged();
       
   109 
       
   110 public:
       
   111 
       
   112     /**
       
   113      * ActivateGc
       
   114      */
       
   115     void DoActivateGc();
       
   116 
       
   117     /**
       
   118      * DeactivateGc
       
   119      */
       
   120     void DoDeactivateGc();
       
   121 
       
   122     };
       
   123 
       
   124 class CTestToolBar : public CAknToolbar
       
   125     {
       
   126     friend class CTestSDKToolbar;
       
   127     };
       
   128 
       
   129 #endif // C_TESTSDKTOOLBARCONTROL_H