Changeset 651 for trunk/src/gui/styles/qs60style_p.h
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/styles/qs60style_p.h
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 94 94 95 95 public: 96 97 // S60 definitions within theme 98 enum ThemeDefinitions { 99 TD_AnimationData, 100 }; 101 102 //Defines which values are contained within animation data (retrieved using TD_AnimationData). 103 //Additionally defines the order in which the items are given out in QList<QVariant>. 104 enum AnimationData { 105 AD_Interval = 0, 106 AD_NumberOfFrames, 107 AD_AnimationPlayMode, //currently not used as themes seem to contain invalid data 108 }; 109 110 // Animation modes 111 enum AnimationMode { 112 AM_PlayOnce = 0, //animation is played exactly once 113 AM_Looping, //animation is repeated until stopped 114 AM_Bounce //animation is played repeatedly until stopped, 115 //but frames are played in reverse order every second time 116 //(no support yet) 117 }; 118 96 119 // S60 look-and-feel font categories 97 120 enum FontCategories { … … 105 128 106 129 enum SkinParts { 107 SP_QgnGrafBarWait ,130 SP_QgnGrafBarWaitAnim, 108 131 SP_QgnGrafBarFrameCenter, 109 132 SP_QgnGrafBarFrameSideL, … … 288 311 }; 289 312 313 #ifdef Q_WS_S60 314 class CAknBitmapAnimation; 315 NONSHARABLE_CLASS (AnimationData) : public QObject 316 { 317 public: 318 AnimationData(const QS60StyleEnums::SkinParts part, int frames, int interval); 319 320 const QS60StyleEnums::SkinParts m_id; 321 int m_frames; 322 int m_interval; 323 QS60StyleEnums::AnimationMode m_mode; 324 }; 325 326 327 NONSHARABLE_CLASS (AnimationDataV2) : public AnimationData 328 { 329 public: 330 AnimationDataV2(const AnimationData &data); 331 ~AnimationDataV2(); 332 333 CAknBitmapAnimation *m_animation; 334 int m_currentFrame; 335 bool m_resourceBased; 336 int m_timerId; 337 }; 338 339 340 class QS60StyleAnimation : public QObject 341 { 342 public: 343 QS60StyleAnimation(const QS60StyleEnums::SkinParts part, int frames, int interval); 344 ~QS60StyleAnimation(); 345 346 public: 347 QS60StyleEnums::SkinParts animationId() const {return m_currentData->m_id;} 348 int frameCount() const { return m_currentData->m_frames;} 349 int interval() const {return m_currentData->m_interval;} 350 QS60StyleEnums::AnimationMode playMode() const {return m_currentData->m_mode;} 351 CAknBitmapAnimation* animationObject() const {return m_currentData->m_animation;} 352 bool isResourceBased() const {return m_currentData->m_resourceBased;} 353 int timerId() const {return m_currentData->m_timerId;} 354 int currentFrame() const {return m_currentData->m_currentFrame;} 355 356 void setFrameCount(const int &frameCount) {m_currentData->m_frames = frameCount;} 357 void setInterval(const int &interval) {m_currentData->m_interval = interval;} 358 void setAnimationObject(CAknBitmapAnimation* animation); 359 void setResourceBased(bool resourceBased) {m_currentData->m_resourceBased = resourceBased;} 360 void setTimerId(const int &timerId) {m_currentData->m_timerId = timerId;} 361 void setCurrentFrame(const int ¤tFrame) {m_currentData->m_currentFrame = currentFrame;} 362 363 void resetToDefaults(); 364 365 private: //data members 366 //TODO: consider changing these to non-pointers as the classes are rather small anyway 367 AnimationData *m_defaultData; 368 AnimationDataV2 *m_currentData; 369 }; 370 371 #endif //Q_WS_S60 372 373 290 374 class QFocusFrame; 375 class QProgressBar; 376 class QS60StyleAnimation; 291 377 292 378 // Private class … … 372 458 SF_StateDisabled = 0x0020, 373 459 SF_ColorSkinned = 0x0040, // pixmap is colored with foreground pen color 460 SF_Animation = 0x0080, 374 461 }; 375 462 … … 402 489 403 490 QFont s60Font(QS60StyleEnums::FontCategories fontCategory, 404 int pointSize = -1 ) const;491 int pointSize = -1, bool resolveFontSize = true) const; 405 492 // clears all style caches (fonts, colors, pixmaps) 406 493 void clearCaches(CacheClearReason reason = CC_UndefinedChange); … … 413 500 static bool isToolBarBackground(); 414 501 static bool hasSliderGrooveGraphic(); 502 static bool isSingleClickUi(); 415 503 416 504 // calculates average color based on button skin graphics (minus borders). … … 455 543 //so that theme graphic background can be drawn. 456 544 static bool canDrawThemeBackground(const QBrush &backgroundBrush); 545 546 static int currentAnimationFrame(QS60StyleEnums::SkinParts part); 547 #ifdef Q_WS_S60 548 549 //No support for animations on emulated style 550 void startAnimation(QS60StyleEnums::SkinParts animation); 551 void stopAnimation(QS60StyleEnums::SkinParts animation); 552 static QS60StyleAnimation* animationDefinition(QS60StyleEnums::SkinParts part); 553 554 #endif 457 555 458 556 private: … … 485 583 QPainter *painter, SkinElementFlags flags = KDefaultSkinElementFlags); 486 584 487 static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize); 585 static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, 586 int pointSize, bool resolveFontSize); 488 587 489 588 static QSize screenSize(); … … 497 596 498 597 QPointer<QFocusFrame> m_focusFrame; 598 599 #ifdef Q_WS_S60 600 //list of progress bars having animation running 601 QList<QProgressBar *> m_bars; 602 #endif 603 499 604 }; 500 605
Note:
See TracChangeset
for help on using the changeset viewer.