classicui_pub/generic_button_api/inc/AknButton.h
branchRCL_3
changeset 25 941195f2d488
parent 9 aabf2c525e0f
child 51 fcdfafb36fe7
equal deleted inserted replaced
23:3d340a0166ff 25:941195f2d488
   351         /**
   351         /**
   352          * @param aDimmedIconCreatedByButton ETrue, if the dimmed icon of the state is 
   352          * @param aDimmedIconCreatedByButton ETrue, if the dimmed icon of the state is 
   353          * created by owning Button
   353          * created by owning Button
   354          */
   354          */
   355         void SetGeneratedDimmedIcon( TBool aDimmedIconCreatedByButton );
   355         void SetGeneratedDimmedIcon( TBool aDimmedIconCreatedByButton );
   356 
   356         
       
   357         /**
       
   358          * Tells if frame update is needed, it is needed when the flag 
       
   359          * KAknButtonStateHasLatchedFrame has changed. 
       
   360          * @return ETrue if flag KAknButtonStateHasLatchedFrame has changed.
       
   361          */
       
   362         TBool FlagsChanged();
       
   363 
       
   364         /**
       
   365          * Frame has been updated. No need to update anymore. 
       
   366          */
       
   367         void ResetFlagsChanged();
       
   368 
       
   369         /**
       
   370          * Checks if text has changed. 
       
   371          * @return ETrue is state's text has changed. 
       
   372          */
       
   373         TBool TextChanged(); 
       
   374         
       
   375         /**
       
   376          * Visual text has been updated, so iTextChanged can be set to EFalse.
       
   377          */
       
   378         void ResetTextChanged(); 
       
   379         
   357         friend class CAknButton;
   380         friend class CAknButton;
   358 
   381 
   359     protected: // data
   382     protected: // data
   360         CGulIcon*   iIcon;                      // bitmaps for normal state
   383         CGulIcon*   iIcon;                      // bitmaps for normal state
   361         CGulIcon*   iDimmedIcon;                // bitmaps for dimmed icon
   384         CGulIcon*   iDimmedIcon;                // bitmaps for dimmed icon
  1161         * @since S60 5.0
  1184         * @since S60 5.0
  1162         * @return Button touch area
  1185         * @return Button touch area
  1163         */
  1186         */
  1164         TRect TouchArea() const;
  1187         TRect TouchArea() const;
  1165 
  1188 
       
  1189         /**
       
  1190         * Enables or disables tactile feedback for button. By default it is 
       
  1191         * enabled. Should be used to temporarily prevent updating of tactile 
       
  1192         * feedback area for performance reasons when button is moved 
       
  1193         * constantly.
       
  1194         *
       
  1195         * @param aEnable, ETrue to enable, EFalse to disable 
       
  1196         * @since S60 5.2
       
  1197         */
       
  1198         IMPORT_C void EnableFeedback( TBool aEnable ); 
       
  1199 
  1166     protected: // Constructors
  1200     protected: // Constructors
  1167 
  1201 
  1168         /**
  1202         /**
  1169          * C++ constructor for the one state button.
  1203          * C++ constructor for the one state button.
  1170          *
  1204          *
  1303          * Continues drawing of the button which has only text.
  1337          * Continues drawing of the button which has only text.
  1304          */
  1338          */
  1305         void DrawTextButton( CWindowGc& aGc ) const;
  1339         void DrawTextButton( CWindowGc& aGc ) const;
  1306 
  1340 
  1307         /**
  1341         /**
       
  1342          * Continues drawing of the button which has text. Called from 
       
  1343          * DrawTextButton and DrawTextAndIconButton
       
  1344          */
       
  1345         void DrawText( CWindowGc& aGc, TRect& aTextRect ) const;
       
  1346 
       
  1347         /**
  1308          * Continues drawing of the button which has only an icon in it.
  1348          * Continues drawing of the button which has only an icon in it.
  1309          */
  1349          */
  1310         void DrawIconButton( CWindowGc& aGc ) const;
  1350         void DrawIconButton( CWindowGc& aGc ) const;
  1311 
  1351 
  1312         /**
  1352         /**
  1428          * Sets new state index 
  1468          * Sets new state index 
  1429          * 
  1469          * 
  1430          * @param aNewIndex New state index
  1470          * @param aNewIndex New state index
  1431          */
  1471          */
  1432         void SetStateIndexL( TInt aNewIndex );
  1472         void SetStateIndexL( TInt aNewIndex );
       
  1473         
       
  1474         /**
       
  1475          * Sets frame IDs for background context. This is called when there
       
  1476          * are possible changes in frame ids. 
       
  1477          */
       
  1478         void SetFrameIDs() const; 
       
  1479 
       
  1480         /**
       
  1481          * Sets frame rects for background context. This is called when
       
  1482          * button's size changes 
       
  1483          */
       
  1484         void SetFrameRects(); 
       
  1485 
       
  1486         /**
       
  1487          * Converts text to visual and clips it. This is called when there
       
  1488          * are possible changes in visual text.
       
  1489          */
       
  1490         void ConvertTextToVisualAndClip() const; 
  1433 
  1491 
  1434     protected: // Data
  1492     protected: // Data
  1435 
  1493 
  1436         // array to keep states
  1494         // array to keep states
  1437         CArrayPtrFlat<CAknButtonState>* iStates;
  1495         CArrayPtrFlat<CAknButtonState>* iStates;