idlehomescreen/nativeuicontroller/inc/aitoolbarbutton.h
changeset 0 f72a12da539e
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 button
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_AITOOLBARBUTTON_H
       
    20 #define C_AITOOLBARBUTTON_H
       
    21 
       
    22 #include <e32std.h>
       
    23 class CGulIcon;
       
    24 class CAknButton;
       
    25 
       
    26 namespace AiNativeUiController
       
    27 {
       
    28 
       
    29 class CAiToolbarButton : public CBase
       
    30     {
       
    31     public: // constructors
       
    32        
       
    33         virtual ~CAiToolbarButton();
       
    34         
       
    35         static CAiToolbarButton* NewL(); 
       
    36         
       
    37         /**
       
    38          * Returns a button constructed using
       
    39          * the information available to button
       
    40          * Ownership transferred
       
    41          */
       
    42         CAknButton* ButtonL();
       
    43         
       
    44         /**
       
    45          * Returns the shortcut id           
       
    46          */
       
    47         TInt ShortcutId();
       
    48         
       
    49         /**
       
    50          * Set the shortcut id 
       
    51          */
       
    52         void SetShortcutId( TInt aId );
       
    53 
       
    54 
       
    55         /**
       
    56          * Return the tooltip
       
    57          */                     
       
    58         TDesC& Tooltip();
       
    59              
       
    60         CGulIcon* Icon( TBool aTransferOwnership = EFalse );
       
    61         
       
    62         /**
       
    63          * Sets tooltip. Creates own copy of the descriptor
       
    64          */
       
    65         void SetTooltipL(const TDesC& aTooltip);
       
    66         
       
    67         /**
       
    68          * Sets icon. Ownership moved if aTransferOwnership is set
       
    69          *
       
    70          * @param aIcon The actual icon
       
    71          * @param aTransferOwnership ETrue in case we take ownership, EFalse
       
    72          *   if caller wants to keep the ownership
       
    73          */
       
    74         void SetIcon( CGulIcon *aIcon, TBool aTransferOwnership = EFalse );
       
    75         
       
    76         /**
       
    77          * Sets the icon ownership to us or to the caller
       
    78          * 
       
    79          * @param aValue ETrue if ownership moved to us. 
       
    80          *               EFalse if caller wishes to keep it
       
    81          */
       
    82         void SetIconExternallyOwned( TBool aValue );
       
    83 
       
    84         
       
    85     private:
       
    86     
       
    87             
       
    88         CAiToolbarButton();
       
    89         
       
    90         void ConstructL();
       
    91         
       
    92     private:
       
    93         //Data
       
    94         
       
    95         /**
       
    96          * Own shortcut id
       
    97          */
       
    98         TInt iShortcutId;
       
    99            /** 
       
   100          * Is icon externally ow internally owned
       
   101          */
       
   102         TBool iIconNotOwned;
       
   103         
       
   104         /**
       
   105          * The icon. Depending on the flag above, owned or not
       
   106          */
       
   107         CGulIcon *iIcon;
       
   108         
       
   109         /**
       
   110          * Owned
       
   111          */
       
   112         HBufC *iTooltip;     
       
   113 
       
   114  
       
   115 
       
   116         
       
   117     };
       
   118     
       
   119 }  // namespace AiNativeUiController
       
   120 
       
   121 #endif //C_AITOOLBARBUTTON_H
       
   122 
       
   123 // End of File.