00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __AKNUTILS_H__
00026 #define __AKNUTILS_H__
00027
00028 #include <eiktxlbm.h>
00029 #include <avkon.hrh>
00030 #include <avkon.rsg>
00031 #include <coedef.h>
00032 #include <coecobs.h>
00033 #include <w32std.h>
00034 #include <gulalign.h>
00035 #include <gulutil.h>
00036 #include <eikenv.h>
00037 #include <biditext.h>
00038 #include <eiksbfrm.h>
00039 #include <AknsConstants.h>
00040 #include <aknenv.h>
00041
00042 #include <aknlayout.lag>
00043
00044
00045 const TInt KMaxColumnDataLength = 80;
00046 const TInt KMaxTotalDataLength = 8*KMaxColumnDataLength;
00047
00063 class CCoeControl;
00064 class CEikTextListBox;
00065 class CEikColumnListBox;
00066 class CEikFormattedCellListBox;
00067 class CGulIcon;
00068 class CEikSettingsListBox;
00069 class CAknLAF;
00070 class CEikImage;
00071 class CEikMfne;
00072 class CEikListBox;
00073 class CEikLabel;
00074 class CEikEdwin;
00075 class CEikMenuPane;
00076 class CAknPopupField;
00077 class CListBoxView;
00078 class CAknColumnListBox;
00079 class CEikSecretEditor;
00080 class CFindExtension;
00081 class CAknLayoutFont;
00082 class TAknFontSpecification;
00083 class CAknAppUiBase;
00084 class TAknWindowLineLayout;
00085 class TAknMultiLineTextLayout;
00086 class TAknTextLineLayout;
00087
00092 const TInt KDefaultClipWidth = -1;
00093 const TUint KDefaultClipChar = TUint(0x2026);
00094
00095
00096 const TInt KAknLayoutUtilsDoNotOverride = -1;
00097
00105 class AknTextUtils
00106 {
00107 public:
00108 enum TClipDirection
00109 {
00110 EDoNotClip,
00111 EClipFromEnd,
00112 EClipFromBeginning
00113 };
00126 IMPORT_C static TBool ClipToFit(TDes& aBuffer,
00127 const CFont& aFont,
00128 TInt aMaxWidthInPixels,
00129 TClipDirection aDir=EClipFromEnd,
00130 TInt aClipWidth = KDefaultClipWidth,
00131 const TDesC &aClipString=_L("..."));
00132
00139 IMPORT_C static TBool ClipToFit(TDes& aBuffer,
00140 TClipDirection aDir,
00141 CEikFormattedCellListBox *aListBox,
00142 TInt aItemIndex,
00143 TInt aSubCellNumber);
00144
00151 IMPORT_C static TBool ClipToFit(TDes& aBuffer,
00152 TClipDirection aDir,
00153 CEikColumnListBox *aListBox,
00154 TInt aItemIndex,
00155 TInt aColumnNumber);
00156
00157
00158
00159 static TBool DoClipToFit(
00160 TDes& aBuffer,
00161 const CFont& aFont,
00162 TInt aMaxWidthInPixels,
00163 TClipDirection aDir,
00164 TInt aClipWidth,
00165 const TDesC& aClipString );
00166
00177 IMPORT_C static void WrapToArrayL(
00178 const TDesC& aStringToWrap,
00179 const CArrayFix<TInt>& aLineWidthArray,
00180 const CFont& aFont,
00181 CArrayFix<TPtrC>& aWrappedArray);
00182
00193 IMPORT_C static void WrapToArrayL(
00194 const TDesC& aStringToWrap,
00195 TInt aLineWidth,
00196 const CFont& aFont,
00197 CArrayFix<TPtrC>& aWrappedArray );
00198
00215 IMPORT_C static void WrapToArrayAndClipL(
00216 TDes& aStringToWrap,
00217 const CArrayFix<TInt>& aLineWidthArray,
00218 const CFont& aFont,
00219 CArrayFix<TPtrC>& aWrappedArray );
00220
00238 IMPORT_C static void ChopToArrayAndClipL(
00239 TDes& aStringToChop,
00240 const CArrayFix<TInt>& aLineWidthArray,
00241 const CFont& aFont,
00242 CArrayFix<TPtrC>& aChoppedArray);
00243
00261 IMPORT_C static void ChopToArrayAndClipL(
00262 TDes& aStringToChop,
00263 TInt aLineWidth,
00264 const CFont& aFont,
00265 CArrayFix<TPtrC>& aChoppedArray );
00266
00279 IMPORT_C static void WrapToStringL(
00280 const TDesC& aStringToWrap,
00281 const CArrayFix<TInt>& aLineWidthArray,
00282 const CFont& aFont,
00283 TDes& aWrappedString );
00284
00299 IMPORT_C static void WrapToStringAndClipL(
00300 const TDesC& aStringToWrap,
00301 const CArrayFix<TInt>& aLineWidthArray,
00302 const CFont& aFont,
00303 TDes& aWrappedString );
00304
00320 IMPORT_C static void StripCharacters(TDes &aDes, const TDesC &aCharacters);
00321
00333 IMPORT_C static void ReplaceCharacters(TDes &aDes, const TDesC &aChars, TChar aReplacement);
00334
00342 IMPORT_C static void PackWhiteSpaces(TDes &aDes, const TDesC &aWhiteSpaceChars);
00343
00344
00345
00346 static void WrapToStringL(
00347 const TDesC& aStringToWrap,
00348 const CArrayFix<TInt>& aLineWidthArray,
00349 const CFont& aFont,
00350 TDes& aWrappedString,
00351 TInt aFlags,
00352 TInt aDirectionality );
00353
00354 static void WrapToArrayL(
00355 TDes& aStringToWrap,
00356 const CArrayFix<TInt>* aLineWidthArray,
00357 const CFont& aFont,
00358 CArrayFix<TPtrC>& aWrappedArray,
00359 TInt aLineWidth,
00360 TInt aFlags,
00361 TInt aDirectionality );
00362
00363 static void ChopToArrayAndClipL(
00364 TDes& aStringToChop,
00365 const CArrayFix<TInt>* aLineWidthArray,
00366 const CFont& aFont,
00367 CArrayFix<TPtrC>& aChoppedArray,
00368 TInt aLineWidth );
00369
00377 static TBool IsEmptyText( const TDesC& aTextToTest );
00378
00393 IMPORT_C static void LanguageSpecificNumberConversion(TDes &aDes);
00394
00403 IMPORT_C static void ConvertDigitsTo( TDes& aDes, TDigitType aDigitType );
00404
00417 IMPORT_C static TBidiText::TDirectionality CurrentScriptDirectionality();
00418
00425 static TDigitType InputLanguageFilteredDigitType();
00426
00433 static TDigitType DisplayTextLanguageFilteredDigitType();
00434
00441 IMPORT_C static TDigitType NumericEditorDigitType();
00442
00459 IMPORT_C static void DisplayTextLanguageSpecificNumberConversion(TDes &aDes);
00460
00472 IMPORT_C static TDigitType TextEditorDigitType();
00473
00474 enum TDigitModeQueryType {
00475 EDigitModeEditorDefault,
00476 EDigitModeUserModifiableEditor,
00477 EDigitModeShownToUser,
00478 EDigitModeNumberEditor,
00479 EDigitModeLatinNumberEditor
00480 };
00495 IMPORT_C static TBool DigitModeQuery(TDigitModeQueryType aQueryType = EDigitModeShownToUser);
00496
00508 IMPORT_C static HBufC* ConvertFileNameL(const TDesC& aDes);
00509
00510
00515 IMPORT_C static HBufC* LoadScalableTextL(CCoeEnv& aCoe, TInt aResourceId);
00516
00521 IMPORT_C static HBufC* LoadScalableTextLC(CCoeEnv& aCoe, TInt aResourceId);
00522
00527 IMPORT_C static TInt LoadScalableText(CCoeEnv& aCoe, TInt aResourceId, TDes& aBuffer );
00528
00533 IMPORT_C static HBufC* ClipAccordingScreenOrientationLC(CCoeEnv& aCoe, HBufC* aBuf);
00534
00555 IMPORT_C static TPtrC ChooseScalableText(
00556 const TDesC& aText,
00557 const CFont& aFont,
00558 TInt aMaxWidthInPixels );
00559 };
00560
00561 _LIT(KAknStripTabs, "\t");
00562 _LIT(KAknStripListControlChars, "\t\n");
00563 _LIT(KAknReplaceTabs, "\t");
00564 _LIT(KAknReplaceListControlChars, "\t\n");
00565 _LIT(KAknCommonWhiteSpaceCharacters, " \n\t\r");
00566
00577 class AknSelectionService
00578 {
00579 public:
00582 IMPORT_C static void HandleSelectionListProcessCommandL(
00583 TInt aCommand,
00584 CEikListBox* aListBox);
00585
00588 IMPORT_C static void HandleMultiselectionListProcessCommandL(
00589 TInt aCommand,
00590 CEikListBox* aListBox);
00591
00594 IMPORT_C static void HandleMarkableListProcessCommandL(
00595 TInt aCommand,
00596 CEikListBox* aListBox);
00597
00600 IMPORT_C static TKeyResponse HandleMenuListOfferKeyEventL(
00601 const TKeyEvent& aKeyEvent,
00602 TEventCode aType,
00603 CEikListBox* aListBox);
00604
00607 IMPORT_C static void HandleMarkableListDynInitMenuPane(
00608 TInt aResourceId,
00609 CEikMenuPane *aMenu,
00610 CEikListBox *aListBox);
00611
00614 IMPORT_C static void HandleMarkableListDynInitMenuItem(
00615 CEikMenuPane *aMenu,
00616 CEikListBox *aListBox,
00617 TInt aCommandId,
00618 TBool aCanBeAppliedToMultipleItems);
00619
00622 IMPORT_C static void HandleMarkableListUpdateAfterCommandExecution(
00623 CEikListBox *aListBox);
00624
00627 IMPORT_C static void HandleItemRemovalAndPositionHighlightL(
00628 CEikListBox *aListBox,
00629 TInt aValueOfCurrentItemIndexBeforeRemoval,
00630 TBool aCurrentItemWasRemoved);
00631
00632
00638 IMPORT_C static void HandleItemRemovalAndPositionHighlightL(
00639 CEikListBox *aListBox,
00640 TInt aValueOfCurrentItemIndexBeforeRemoval,
00641 CArrayFix<TInt> &aIndexesOfRemovedItemsBeforeRemoval);
00642 };
00643
00644
00645
00646 class CAknSearchField;
00647
00660 class AknFind
00661 {
00662 public:
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674 IMPORT_C static void HandleFindPopupProcessCommandL(
00675 TInt aCommand,
00676 CEikListBox* aListBox,
00677 CAknSearchField* aSearchField,
00678 CCoeControl* aParentControl);
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693 IMPORT_C static TKeyResponse HandleFindOfferKeyEventL(
00694 const TKeyEvent& aKeyEvent,
00695 TEventCode aType,
00696 CCoeControl* aListBoxParent,
00697 CEikListBox* aListBox,
00698 CAknSearchField* aSearchField,
00699 TBool isFindPopup,
00700 TBool &aNeedRefresh);
00701
00702
00703
00704
00705
00706
00707
00708
00709 IMPORT_C static void HandleFindSizeChanged(
00710 CCoeControl* aParentControl,
00711 CEikListBox* aListBox,
00712 CAknSearchField* aSearchField,
00713 TBool ispopup = ETrue,
00714 TInt aFindWindowResourceId = R_AVKON_POPUP_FIND_WINDOW,
00715 TInt aListAreaId = R_AVKON_LIST_GEN_PANE,
00716 TInt aListResourceIdWithFindPopup =
00717 R_AVKON_LIST_GEN_PANE_WITH_FIND_POPUP,
00718 TInt aFindWindowParentResourceId =
00719 R_AVKON_MAIN_PANE_WITH_STATUS_PANE);
00720
00731 IMPORT_C static void HandleFixedFindSizeChanged(
00732 CCoeControl* aParentControl,
00733 CAknColumnListBox* aListBox,
00734 CAknSearchField* aSearchField);
00735
00745 IMPORT_C static void HandlePopupFindSizeChanged(
00746 CCoeControl* aParentControl,
00747 CEikListBox* aListBox,
00748 CAknSearchField* aSearchField);
00749
00765 IMPORT_C static void HandleFindSizeChangedLayouts(
00766 CCoeControl* aParentControl,
00767 CEikListBox* aListBox,
00768 CAknSearchField* aSearchField,
00769 const TAknWindowLineLayout& aFindWindow,
00770 const TAknWindowLineLayout& aListArea,
00771 TBool aIsPopup,
00772 const TAknWindowLineLayout& aFindWindowParent );
00773
00774 public:
00775
00785 IMPORT_C static TBool IsFindMatch(const TDesC& aItemText,
00786 const TDesC& aSearchText);
00787
00796 IMPORT_C static TBool IsFindWordSeparator(TChar aCh);
00797
00798
00813 IMPORT_C static TBool IsAdaptiveFindMatch( const TDesC& aItemText,
00814 const TDesC& aSearchText,
00815 HBufC*& aNextChars );
00816
00824 static void UpdateNextCharsL( HBufC*& aNextChars, TChar aCh );
00825
00834 static void UpdateNextCharsL( HBufC*& aNextChars, const TDesC& aItemString );
00835
00847 IMPORT_C static void UpdateNextCharsFromString( HBufC*& aNextChars, const TDesC& aItemString );
00848
00858 IMPORT_C static void UpdateItemTextAccordingToFlag( const TDesC& aInputText,
00859 TBitFlags32 aColumnFlag,
00860 TDes& aOutText );
00861
00871 static void HandleFindPaneVisibility(CAknSearchField* aSearchField,
00872 TBool ispopup,
00873 TBool textchanged,
00874 TBool &aNeedRefresh);
00875 };
00876
00877
00882 class AknEditUtils
00883 {
00884 public:
00885
00887 struct SAknEditorParameters
00888 {
00890 TInt iEditingSpace;
00891
00893 TInt iEditingWindow;
00894
00899 TInt iCharacterCase;
00900
00905 TInt iJustification;
00906
00908 TBool iAllowedToMoveInsertionPoint;
00909
00911 TBool iCursorYesNo;
00912
00914 TBool iOverflowYesNo;
00915 };
00916
00917 IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, TInt aResourceId);
00918 IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, TResourceReader& aReader);
00919 IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, const SAknEditorParameters &aParams);
00920
00939 IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin,
00940 TInt aEditingSpace,
00941 TInt aEditingWindow,
00942 TInt aCharacterCase,
00943 TInt aJustification,
00944 TBool aAllowedToMoveInsertionPoint,
00945 TBool aCursorYesNo,
00946 TBool aOverflowYesNo);
00947
00967 IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin,
00968 TInt aEditingSpace,
00969 TInt aEditingWindow,
00970 TInt aCharacterCase,
00971 TInt aJustification,
00972 TBool aAllowedToMoveInsertionPoint,
00973 TBool aCursorYesNo,
00974 TBool aOverflowYesNo,
00975 TBool aIsResizable);
00976
00977 };
00978
00986 class CListBoxNumbers : public CBase
00987 {
00988 public:
00989 IMPORT_C CListBoxNumbers(CEikTextListBox* aListBox);
00990 IMPORT_C void ConstructL();
00991 IMPORT_C void UpdateL();
00992 private:
00993 CEikTextListBox* iListBox;
00994 };
00995
00996 class CAknListBoxFilterItems;
00997
01007 class CAknFilteredTextListBoxModel : public CTextListBoxModel, public MDesCArray
01008 {
01009 public:
01016 IMPORT_C void CreateFilterL(CEikListBox* aListBox, CAknSearchField* aSearchField);
01020 IMPORT_C void RemoveFilter();
01025 IMPORT_C CAknListBoxFilterItems* Filter() const;
01029 IMPORT_C ~CAknFilteredTextListBoxModel();
01030 public:
01035 IMPORT_C virtual TInt NumberOfItems() const;
01041 IMPORT_C virtual TPtrC ItemText(TInt aItemIndex) const;
01042 public:
01047 IMPORT_C const MDesCArray* MatchableTextArray() const;
01048
01049 private:
01050 CAknListBoxFilterItems* iFilter;
01051 private:
01052 IMPORT_C TInt MdcaCount() const;
01053 IMPORT_C TPtrC MdcaPoint(TInt aIndex) const;
01054 private:
01055 IMPORT_C virtual TAny* MListBoxModel_Reserved();
01056 };
01057
01075 class CAknListBoxFilterItems : public CBase, public MCoeControlObserver
01076 {
01077 public:
01086 IMPORT_C CAknListBoxFilterItems(
01087 CEikListBox *aListBox,
01088 CAknSearchField *aSearchField,
01089 MListBoxModel *aModel,
01090 CListBoxView *aView);
01091
01095 IMPORT_C void ConstructL();
01099 IMPORT_C void ResetFilteringL();
01104 IMPORT_C void UpdateCachedDataL();
01109 IMPORT_C ~CAknListBoxFilterItems();
01110
01111 public:
01116 IMPORT_C CArrayFix<TInt> *SelectionIndexes();
01122 IMPORT_C void UpdateSelectionIndexesL();
01129 IMPORT_C void UpdateSelectionIndexL(TInt aVisibleIndex);
01130
01131 public:
01137 IMPORT_C TInt FilteredNumberOfItems() const;
01144 IMPORT_C TInt FilteredItemIndex(TInt aVisibleItemIndex) const;
01145
01146 public:
01147
01152 IMPORT_C TInt NonFilteredNumberOfItems() const;
01159 IMPORT_C TInt VisibleItemIndex(TInt aOriginalIndex) const;
01160 public:
01167 IMPORT_C TPtrC DefaultMatchableItemFromItem(TPtrC aText);
01168
01169 public:
01174 IMPORT_C void HandleOfferkeyEventL();
01175
01176
01180 IMPORT_C void HandleItemArrayChangeL();
01181
01182 public:
01187 IMPORT_C void SetObserver(MCoeControlObserver *aObserver);
01193 IMPORT_C void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);
01194
01195 public:
01203 IMPORT_C void DeferredSendKeyEventToFepL(TUint aValue);
01211 static TInt IdleCallBack(TAny *aFilterItems);
01212
01213 public:
01221 IMPORT_C void SetParentControl(CCoeControl *aControl);
01226 IMPORT_C void SetPopup();
01227
01228 public:
01234 IMPORT_C void SetListBox(CEikListBox *aListBox);
01240 IMPORT_C void SetSearchField(CAknSearchField *aSearchField);
01246 IMPORT_C void SetModel(MListBoxModel *aModel);
01252 IMPORT_C void SetView(CListBoxView *aView);
01253
01254 public:
01259 IMPORT_C CCoeControl *FindBox() const;
01260
01268 void DeferredSendFullKeyEventToFepL(const TKeyEvent& aEvent);
01269
01270 private:
01271 void NoCriteriaL();
01272 void TightenCriteriaL(const TDesC& aCriteria);
01273 void ReleaseCriteriaL(const TDesC& aCriteria);
01274
01275 void InstallEmptyTextL();
01276 void UninstallEmptyTextL();
01277
01278
01279 void FetchSelectionIndexesFromListBoxL();
01280 void PushSelectionIndexesToListBoxL();
01281 void ClearNextChars();
01282 TBool IsAdaptiveSearch() const;
01283
01284
01285 void HandleItemAdditionL();
01286 void HandleItemRemovalL();
01287 private:
01288 TBool IsItemVisible(const TDesC& aMatchableItemString, const TDesC& aSearchText);
01289 static TBool IsSeparatorCharacter(TChar c);
01290 TBool IsItemSelected(TInt aRealIndex) const;
01291 private:
01292 CArrayFix<TInt> *iShownIndexes;
01293 CArrayFix<TInt> *iSelectionIndexes;
01294 HBufC *iOldSearchCriteria;
01295 MListBoxModel *iModel;
01296 CListBoxView *iView;
01297 TInt iOldItemCount;
01298 HBufC* iEmptyListText;
01299 CEikListBox* iListBox;
01300 CAknSearchField* iSearchField;
01301 TBuf<256> iMatchableText;
01302 MCoeControlObserver *iObserver;
01303 CFindExtension *iExtension;
01304 TUint iKeyValue;
01305 CCoeControl *iParentControl;
01306 TBool iIsPopup;
01307 TBool iDisableChangesToShownIndexes;
01308 };
01309
01310
01317 template<class T>
01318 class NoOptimizationView : public T
01319 {
01320 public:
01321 virtual void VScrollTo(TInt aNewTopItemIndex, TRect& aMinRedrawRect)
01322 {
01323
01324 if (this->RedrawDisabled())
01325 return;
01326 if (this->iTopItemIndex == aNewTopItemIndex)
01327 return;
01328 aMinRedrawRect.SetRect(this->iViewRect.iTl,this->iViewRect.Size());
01329 this->SetTopItemIndex(aNewTopItemIndex);
01330 this->Draw(&aMinRedrawRect);
01331
01332 }
01333 };
01334
01335
01342 class AknLAFUtils
01343 {
01344 public:
01345 static void DrawLines(CGraphicsContext* aGc,
01346 const TRect& mainpane,
01347 TInt x);
01348 IMPORT_C static void ReplaceColumn(TPtr aTarget, TDesC* aSource,
01349 TDesC* aReplacement, TChar aColumnSeparator,
01350 TInt aColumn);
01351 };
01352
01353
01363 struct SAknLayoutGfx;
01364 struct SAknLayoutText;
01365 struct SAknLayoutCmd;
01366 struct SAknLayoutGfx;
01367
01368 struct SAknLayoutPos
01369 {
01370 TInt l, t, r, b, W, H;
01371
01372 typedef SAknLayoutPos ItemType;
01373 static void ReadResource(TResourceReader& aReader, ItemType& aTarget);
01374 };
01375 template<class T> class CArrayReader;
01376 class CAknGenericReader : public CBase
01377 {
01378 public:
01379 IMPORT_C void ConstructL(TInt aResourceId);
01380 IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
01381 IMPORT_C ~CAknGenericReader();
01382
01383 IMPORT_C const SAknLayoutGfx* GfxItem(TInt aIndex) const;
01384 IMPORT_C const SAknLayoutText* TextItem(TInt aIndex) const;
01385 IMPORT_C const SAknLayoutCmd* CmdItem(TInt aIndex) const;
01386 IMPORT_C const SAknLayoutGfx* AreaItem(TInt aIndex) const;
01387
01388 CArrayReader<SAknLayoutGfx>* iGfx;
01389 CArrayReader<SAknLayoutText>* iText;
01390 CArrayReader<SAknLayoutCmd>* iCmd;
01391 CArrayReader<SAknLayoutGfx>* iArea;
01392 };
01393
01394
01395
01396
01397
01398
01399 const TInt AknLayoutUtilsNoValue = ELayoutEmpty;
01400
01432 class AknLayoutUtils
01433 {
01434 public:
01435
01436 struct SAknLayoutText
01437 {
01438 TInt iFont, iC, iL, iR, iB, iW, iJ;
01439 };
01440 struct SAknLayoutTextMultiline
01441 {
01442 TInt iFont, iC, iL, iR, iB, iW, iJ, iNumberOfLinesShown, iNextLineB;
01443 };
01444 typedef SAknLayoutTextMultiline SAknLayoutLabel;
01445 typedef SAknLayoutTextMultiline SAknLayoutEdwin;
01446 typedef SAknLayoutText SAknLayoutMfne;
01447 typedef SAknLayoutText SAknLayoutSecEd;
01448 struct SAknLayoutRect
01449 {
01450 TInt iC, iL, iT, iR, iB, iW, iH;
01451 };
01452 typedef SAknLayoutRect SAknLayoutControl;
01453 typedef SAknLayoutRect SAknLayoutImage;
01454
01458 IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01459 const TRect& aLabelParent,
01460 TInt aResourceId,
01461 const CFont* aCustomFont=0);
01462
01466 IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01467 const TRect& aLabelParent,
01468 TResourceReader& aReader,
01469 const CFont* aCustomFont=0);
01470
01474 IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01475 const TRect& aLabelParent,
01476 const SAknLayoutLabel& aLayout,
01477 const CFont *aCustomFont=0);
01478
01482 IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01483 const TRect& aLabelParent,
01484 const TAknMultiLineTextLayout& aLayout,
01485 const CFont *aCustomFont=0);
01486
01490 IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01491 const TRect& aLabelParent,
01492 const TAknTextLineLayout& aLayout,
01493 const CFont *aCustomFont=0);
01494
01507 IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01508 const TRect& aLabelParent,
01509 TInt font, TInt C,
01510 TInt l, TInt r,
01511 TInt B, TInt W,
01512 TInt J, TInt NextLineB=0,
01513 const CFont* aCustomFont=0);
01514
01518 IMPORT_C static void LayoutEdwin(CEikEdwin* aEdwin,
01519 const TRect& aEdwinParent,
01520 TInt aResourceId,
01521 TInt aNumberOfLines = 0,
01522 const CFont* aCustomFont=0,
01523 TBool aMinimizeEdwinView=EFalse);
01527 IMPORT_C static void LayoutEdwin(CEikEdwin* aEdwin,
01528 const TRect& aEdwinParent,
01529 TResourceReader& aReader,
01530 TInt aNumberOfLines = 0,
01531 const CFont* aCustomFont=0,
01532 TBool aMinimizeEdwinView=EFalse);
01533
01537 IMPORT_C static void LayoutEdwin(CEikEdwin* aEdwin,
01538 const TRect& aEdwinParent,
01539 const SAknLayoutEdwin& aLayout,
01540 const CFont* aCustomFont=0,
01541 TBool aMinimizeEdwinView=EFalse);
01542
01547 IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01548 const TRect& aEdwinParent,
01549 const TAknMultiLineTextLayout& aLayout,
01550 const CFont* aCustomFont=0,
01551 TBool aMinimizeEdwinView=EFalse);
01552
01553 IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01554 const TRect& aEdwinParent,
01555 const TAknMultiLineTextLayout& aLayout,
01556 TAknsQsnTextColorsIndex aOverrideColor,
01557 const CFont* aCustomFont=0,
01558 TBool aMinimizeEdwinView=EFalse );
01559
01560
01561
01562 IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01563 const TRect& aEdwinParent,
01564 const TAknTextLineLayout& aLayout,
01565 const CFont* aCustomFont=0,
01566 TBool aMinimizeEdwinView=EFalse );
01567
01568 IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01569 const TRect& aEdwinParent,
01570 const TAknTextLineLayout& aLayout,
01571 TAknsQsnTextColorsIndex aOverrideColor,
01572 const CFont* aCustomFont=0,
01573 TBool aMinimizeEdwinView=EFalse );
01574
01602 IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01603 const TRect& aEdwinParent,
01604 const TAknTextLineLayout& aLayout,
01605 TInt aNumberOfLinesToShowOverRide,
01606 TInt aBaselineSeparationOverRide,
01607 TAknsQsnTextColorsIndex aOverrideColor,
01608 TInt& aNumberOfVisibleLines );
01609
01623 IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01624 const TRect& aEdwinParent,
01625 TInt font,
01626 TInt C,
01627 TInt l,
01628 TInt r,
01629 TInt B,
01630 TInt W,
01631 TInt J,
01632 TInt aNumberOfLinesShown,
01633 TInt aNextLineBaseline,
01634 const CFont* aCustomFont=0 ,
01635 TBool aMinimizeEdwinView=EFalse );
01636
01637 IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01638 const TRect& aEdwinParent,
01639 TInt font,
01640 TInt C,
01641 TInt l,
01642 TInt r,
01643 TInt B,
01644 TInt W,
01645 TInt J,
01646 TInt aNumberOfLinesShown,
01647 TInt aNextLineBaseline,
01648 TAknsQsnTextColorsIndex aOverrideColor,
01649 const CFont* aCustomFont=0 ,
01650 TBool aMinimizeEdwinView=EFalse );
01654 IMPORT_C static TRect MinimizedEdwinRect(const CEikEdwin *aEdwin);
01655
01656
01660 IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01661 const TRect& aMfneParent,
01662 TInt aResourceId);
01666 IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01667 const TRect& aMfneParent,
01668 TResourceReader& aReader);
01669
01670 IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01671 const TRect& aMfneParent,
01672 const SAknLayoutMfne& aLayout);
01673
01674 IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01675 const TRect& aMfneParent,
01676 const TAknTextLineLayout& aLayout);
01677
01678 IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01679 const TRect& aMfneParent,
01680 TInt font, TInt C, TInt l, TInt r,
01681 TInt B, TInt W, TInt J);
01682
01686 IMPORT_C static void LayoutControl(CCoeControl* aControl,
01687 const TRect& aControlParent,
01688 TInt aResourceId);
01692 IMPORT_C static void LayoutControl(CCoeControl* aControl,
01693 const TRect& aControlParent,
01694 TResourceReader& aReader);
01695
01696 IMPORT_C static void LayoutControl(CCoeControl* aControl,
01697 const TRect& aControlParent,
01698 const SAknLayoutControl& aLayout);
01699
01700 IMPORT_C static void LayoutControl(CCoeControl* aControl,
01701 const TRect& aControlParent,
01702 const TAknWindowLineLayout& aLayout);
01703
01704 IMPORT_C static void LayoutControl(CCoeControl* aControl,
01705 const TRect& aControlParent,
01706 TInt , TInt l, TInt t, TInt r, TInt b,
01707 TInt W, TInt H);
01708
01712 IMPORT_C static void LayoutImage(CEikImage* aImage,
01713 const TRect& aParent,
01714 TInt aResourceId);
01718 IMPORT_C static void LayoutImage(CEikImage* aImage,
01719 const TRect& aParent,
01720 TResourceReader& aReader);
01721
01722 IMPORT_C static void LayoutImage(CEikImage* aImage,
01723 const TRect& aParent,
01724 const SAknLayoutControl& aLayout);
01725
01726 IMPORT_C static void LayoutImage(CEikImage* aImage,
01727 const TRect& aParent,
01728 const TAknWindowLineLayout& aLayout);
01729
01730 IMPORT_C static void LayoutImage(CEikImage* aImage,
01731 const TRect& aParent,
01732 TInt C, TInt l, TInt t, TInt r, TInt b,
01733 TInt W, TInt H);
01734
01738 IMPORT_C static void LayoutSecretEditor(CEikSecretEditor* aSecEd,
01739 const TRect& aParent,
01740 const SAknLayoutText& aLayout);
01741
01742 IMPORT_C static void LayoutSecretEditor(CEikSecretEditor* aSecEd,
01743 const TRect& aParent,
01744 const TAknTextLineLayout& aLayout);
01745
01746 public:
01752 IMPORT_C static TRect TextRectFromCoords(const TRect& aParent,
01753 const CFont* aFont,
01754 TInt l, TInt r,
01755 TInt B, TInt W,
01756 TInt LB = 0);
01757
01758 IMPORT_C static TRect RectFromCoords(const TRect& aParent,
01759 TInt l, TInt t, TInt r, TInt b,
01760 TInt W, TInt H);
01761
01780 IMPORT_C static const CFont* FontFromId(TInt aFontId, const CFont* aCustomFont=0);
01781
01799 IMPORT_C static const CAknLayoutFont* LayoutFontFromId(TInt aId,
01800 const CAknLayoutFont *aCustomFont = 0);
01801
01811 IMPORT_C static CAknLayoutFont* CreateLayoutFontFromSpecificationL(
01812 const TAknFontSpecification& aSpec );
01813
01826 IMPORT_C static CAknLayoutFont* CreateLayoutFontFromSpecificationL(
01827 const TTypeface& aTypeface,
01828 const TAknFontSpecification& aSpec);
01829
01833 IMPORT_C static const CFont* FontFromName(const TDesC& aName);
01834
01835 IMPORT_C static CGraphicsContext::TTextAlign TextAlignFromId(TInt aId);
01836
01837 IMPORT_C static TGulAlignment GulAlignFromId(TInt aId);
01838
01839 IMPORT_C static TInt CursorHeightFromFont(const TFontSpec& aFont);
01840
01841 IMPORT_C static TInt CursorWidthFromFont (const TFontSpec& aFont);
01842
01843 IMPORT_C static TInt CursorAscentFromFont(const TFontSpec& aFont);
01844
01845 IMPORT_C static void CursorExtensionsFromFont(const TFontSpec& ,
01846 TInt& aFirstExtension,
01847 TInt& aSecondExtension);
01848
01849 IMPORT_C static TInt HighlightLeftPixelsFromFont (const TFontSpec& aFont);
01850
01851 IMPORT_C static TInt HighlightRightPixelsFromFont(const TFontSpec& aFont);
01852 static void HighlightExtensionsFromFont(const TInt fontid,
01853 TInt& aLeft, TInt& aRight,
01854 TInt& aTop, TInt& aBottom);
01855
01868 static const CAknLayoutFont* MatchFontFromSystemFontArray(
01869 const TFontSpec& aSpec, MGraphicsDeviceMap* aMap );
01870
01871 IMPORT_C static TBool LayoutMirrored();
01872
01873
01874
01875
01876
01877
01878
01879
01880
01881
01882 IMPORT_C static EVariantFlag Variant();
01883
01884 IMPORT_C static ESubVariantFlag SubVariant();
01885
01886 IMPORT_C static void OverrideControlColorL(
01887 CCoeControl& aControl,
01888 TLogicalColor aLogicalColor,
01889 TRgb aColor);
01890
01891
01892
01893
01894
01895
01896
01897
01898
01899
01900
01901
01902
01903
01904
01905 IMPORT_C static CEikScrollBarFrame::TScrollBarType DefaultScrollBarType(CAknAppUiBase* aApplication);
01906
01907
01908
01909
01910
01911
01912
01913
01914
01915
01916
01917
01918
01919
01920
01921
01922
01923
01924
01925
01926
01927
01928
01929
01930
01931
01932
01933
01934
01935 IMPORT_C static void LayoutVerticalScrollBar(
01936 CEikScrollBarFrame* aScrollBarFrame,
01937 const TRect& aControlParent,
01938 const TAknWindowLineLayout& aLayout);
01939
01940
01941
01942
01943
01944
01945
01946
01947
01948
01949
01950
01951
01952
01953 IMPORT_C static void LayoutHorizontalScrollBar(
01954 CEikScrollBarFrame* aScrollBarFrame,
01955 const TRect& aControlParent,
01956 const TAknWindowLineLayout& aLayout);
01957
01958 public:
01959
01963 enum TAknLayoutMetrics
01964 {
01966 EScreen,
01967
01969 EApplicationWindow,
01970
01972 EStatusPane,
01973
01975 EMainPane,
01976
01978 EControlPane,
01979
01981 ESignalPane,
01982
01984 EContextPane,
01985
01987 ETitlePane,
01988
01990 EBatteryPane,
01991
01996 EUniversalIndicatorPane,
01997
02003 ENaviPane,
02004
02008 EFindPane,
02009
02011 EWallpaperPane,
02012
02017 EIndicatorPane,
02018
02020 EAColunm,
02021
02023 EBColunm,
02024
02029 ECColunm,
02030
02035 EDColunm,
02036
02038 EStatusPaneSecondary,
02039
02041 EControlPaneSecondary,
02042
02044 EStaconTop,
02045
02047 EStaconBottom,
02048
02050 EPopupParent,
02051
02053 EStatusPaneBottom = EStatusPaneSecondary,
02054
02056 EControlPaneBottom = EControlPaneSecondary,
02057
02059 EControlPaneTop = EControlPane,
02060
02062 EStatusPaneTop = EStatusPane
02063 };
02064
02065
02079 IMPORT_C static TBool LayoutMetricsRect(TAknLayoutMetrics aParam, TRect& aRect);
02080
02094 IMPORT_C static TBool LayoutMetricsSize(TAknLayoutMetrics aParam, TSize& aSize);
02095
02109 IMPORT_C static TBool LayoutMetricsPosition(TAknLayoutMetrics aParan, TPoint& aPos);
02110 public:
02125 static TInt CorrectBaseline(TInt aParentHeight, TInt aBaseline, TInt aFontId);
02126
02130 static void CorrectFontId(TRect aParent, TInt at, TInt aH, TInt ab, TInt &aFontId);
02131
02138 IMPORT_C static TBool ScalableLayoutInterfaceAvailable();
02139
02140
02141
02142
02143
02144 enum TAknCbaLocation
02145 {
02146 EAknCbaLocationBottom,
02147 EAknCbaLocationRight,
02148 EAknCbaLocationLeft
02149 };
02150
02159 IMPORT_C static TAknCbaLocation CbaLocation();
02160
02167 static TRect HighlightBasedRect( const TRect& aHighlightRect, CCoeControl* aControl );
02168
02172 enum TAknMainPaneState
02173 {
02174 EAknMainPaneForTinyStatusPane = 0x0001
02175 };
02176 IMPORT_C static TAknMainPaneState MainPaneState();
02177
02182 IMPORT_C static TBool PenEnabled();
02183
02188 IMPORT_C static TBool MSKEnabled();
02189
02215 IMPORT_C static void GetEdwinVerticalPositionAndHeightFromLines(
02216 TInt aParentHeight,
02217 const TAknTextLineLayout& aLayout,
02218 TInt aBaselineSeparationOverRide,
02219 TInt aNumberOfLinesToShowOverRide,
02220 TInt& aEdwinVerticalPositionRelativeToParent,
02221 TInt& aEdwinHeight
02222 );
02223
02244 IMPORT_C static TInt EdwinLinesWithinHeight (
02245 const TAknTextLineLayout& aLayout,
02246 TInt aBaselineSeparationOverride,
02247 TInt aMaxHeight,
02248 TInt& aUsedHeight
02249 );
02250 };
02251
02256 class TAknLayoutText
02257 {
02258 public:
02259 IMPORT_C TAknLayoutText();
02264 IMPORT_C void LayoutText(const TRect& aParent, TInt aResourceId,
02265 const CFont* aCustomFont=0);
02266
02267 IMPORT_C void LayoutText(const TRect& aParent, TResourceReader& aReader,
02268 const CFont* aCustomFont=0);
02269
02270 IMPORT_C void LayoutText(const TRect& aParent,
02271 const AknLayoutUtils::SAknLayoutText& aLayout,
02272 const CFont* aCustomFont=0);
02273
02274 IMPORT_C void LayoutText(const TRect& aParent,
02275 const TAknTextLineLayout& aLayout,
02276 const CFont* aCustomFont=0);
02277
02278 IMPORT_C void LayoutText(const TRect& aParent, TInt fontid,
02279 TInt C, TInt l, TInt r, TInt B, TInt W, TInt J,
02280 const CFont* aCustomFont=0);
02281
02284 IMPORT_C void DrawText(CGraphicsContext& aGc, const TDesC& aText) const;
02285
02291 IMPORT_C void DrawText(
02292 CGraphicsContext& aGc,
02293 const TDesC& aText,
02294 TBool aUseLogicalToVisualConversion ) const;
02295
02296 IMPORT_C void DrawText(
02297 CGraphicsContext& aGc,
02298 const TDesC& aText,
02299 TBool aUseLogicalToVisualConversion,
02300 const TRgb &aColor) const;
02301
02302
02303 public:
02310 IMPORT_C TRect TextRect() const;
02311 const CFont *Font() const { return iFont; }
02312 TRgb Color() const { return AKN_LAF_COLOR_STATIC(iColor); }
02313 CGraphicsContext::TTextAlign Align() const { return iAlign; }
02334 TInt BaselineOffset() const;
02335 private:
02336 TRect iTextRect;
02337 const CFont *iFont;
02338 TInt iColor;
02339 TInt iOffset;
02340 CGraphicsContext::TTextAlign iAlign;
02341 friend class CBubbleOutlookNumberEntry;
02342 };
02343
02352 class TAknLayoutRect
02353 {
02354 public:
02355 IMPORT_C TAknLayoutRect();
02358 IMPORT_C void LayoutRect(const TRect &aParent, TInt aResourceId);
02359 IMPORT_C void LayoutRect(const TRect &aParent, TResourceReader &aReader);
02360 IMPORT_C void LayoutRect(const TRect &aParent,
02361 const AknLayoutUtils::SAknLayoutRect &aLayout);
02362
02363 IMPORT_C void LayoutRect(const TRect &aParent,
02364 const TAknWindowLineLayout &aLayout);
02365
02366 IMPORT_C void LayoutRect(const TRect &aParent,
02367 TInt C, TInt l, TInt t, TInt r, TInt b,
02368 TInt W, TInt H);
02369
02378 IMPORT_C TRgb Color() const;
02381 IMPORT_C TRect Rect() const;
02382 TBool Valid() const;
02383
02386 IMPORT_C void DrawRect(CWindowGc& aGc) const;
02387 IMPORT_C void DrawOutLineRect(CWindowGc& aGc) const;
02388 IMPORT_C void DrawImage(CBitmapContext& aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask) const;
02389 private:
02390 TInt iColor;
02391 TRect iRect;
02392 };
02393
02397 class AknDraw
02398 {
02399 public:
02406 IMPORT_C static void DrawEmptyList(
02407 const TRect& aRect,
02408 CWindowGc& aGc,
02409 TPtrC aText);
02410
02417 IMPORT_C static void DrawEmptyListForSettingPage(
02418 const TRect &aRect,
02419 CWindowGc &aGc,
02420 TPtrC text);
02421
02428 IMPORT_C static void DrawEmptyListWithFind(
02429 const TRect& aClientRect,
02430 CWindowGc& aGc,
02431 TPtrC aText);
02432
02439 IMPORT_C static void DrawEmptyListHeading(
02440 const TRect &aClientRect,
02441 CWindowGc& aGc,
02442 TPtrC aText);
02443
02444
02453 IMPORT_C static void DrawWindowShadow(
02454 CWindowGc& aGc,
02455 const TAknLayoutRect& aCoverRect,
02456 const TAknLayoutRect& aSecondShadowRect,
02457 const TAknLayoutRect& aFirstShadowRect,
02458 const TAknLayoutRect& aOutlineFrameRect,
02459 const TAknLayoutRect& aInsideAreaRect);
02460
02461 public:
02462
02481 IMPORT_C static void DrawEmptyListImpl( const TRect& aRect,
02482 CWindowGc& aGc,
02483 TPtrC aText,
02484 TInt aLayoutLine1,
02485 TInt aLayoutLine2 );
02486
02487 };
02488
02492 class AknDrawWithSkins
02493 {
02494 public:
02501 IMPORT_C static void DrawEmptyList(
02502 const TRect& aRect,
02503 CWindowGc& aGc,
02504 TPtrC aText,
02505 CCoeControl *aControl);
02506
02513 IMPORT_C static void DrawEmptyListForSettingPage(
02514 const TRect &aRect,
02515 CWindowGc &aGc,
02516 TPtrC text,
02517 CCoeControl *aControl);
02518
02525 IMPORT_C static void DrawEmptyListWithFind(
02526 const TRect& aClientRect,
02527 CWindowGc& aGc,
02528 TPtrC aText,
02529 CCoeControl *aControl);
02530
02537 IMPORT_C static void DrawEmptyListHeading(
02538 const TRect &aClientRect,
02539 CWindowGc& aGc,
02540 TPtrC aText,
02541 CCoeControl *aControl);
02542
02543
02552 IMPORT_C static void DrawWindowShadow(
02553 CWindowGc& aGc,
02554 const TAknLayoutRect& aCoverRect,
02555 const TAknLayoutRect& aSecondShadowRect,
02556 const TAknLayoutRect& aFirstShadowRect,
02557 const TAknLayoutRect& aOutlineFrameRect,
02558 const TAknLayoutRect& aInsideAreaRect,
02559 CCoeControl *aControl);
02560
02561 };
02562
02563
02564
02565
02566
02567
02568 IMPORT_C const CFont *LatinPlain12();
02569 IMPORT_C const CFont *LatinBold12();
02570 IMPORT_C const CFont *LatinBold13();
02571 IMPORT_C const CFont *LatinBold16();
02572 IMPORT_C const CFont *LatinBold17();
02573 IMPORT_C const CFont *LatinBold19();
02574 IMPORT_C const CFont *NumberPlain5();
02575 IMPORT_C const CFont *ClockBold30();
02576 IMPORT_C const CFont *LatinClock14();
02577 const CFont *CalcBold21();
02578 const CFont *CalcOperBold21();
02579 const CFont *CalcOperBold13();
02580
02581
02582
02583 IMPORT_C const CFont *ApacPlain12();
02584 IMPORT_C const CFont *ApacPlain16();
02585
02586
02613 IMPORT_C TInt CompleteWithAppPath( TDes& aFileName );
02614
02623 TBool IsParentRelative(TInt aVal);
02624
02632 IMPORT_C TInt DefaultInputLanguageFromUILanguage(const TInt aUiLanguage);
02633
02642 IMPORT_C void SetKeyblockMode( TAknKeyBlockMode aMode );
02643
02644 namespace AknDateTimeUtils
02645 {
02655 IMPORT_C void ConvertUtcTimeToHomeTime( TTime& aTime );
02656 }
02657
02658 namespace AknLangUtils
02659 {
02665 IMPORT_C HBufC* DisplayLanguageTagL();
02666 }
02667
02668 #endif // __AKNUTILS_H__
02669
02670
02671
02672
02673
02674
02675
02676
02677
02678
02679