50 * @since S60 3.2 |
50 * @since S60 3.2 |
51 * Get the name |
51 * Get the name |
52 * @return Pointer which contains Name |
52 * @return Pointer which contains Name |
53 */ |
53 */ |
54 IMPORT_C TPtr GetName() const; |
54 IMPORT_C TPtr GetName() const; |
|
55 |
|
56 TInt32 Priority() const; |
55 |
57 |
56 protected: |
58 protected: |
57 /** |
59 /** |
58 * @function CCSXHHelpContentBase |
60 * @function CCSXHHelpContentBase |
59 * @since S60 3.2 |
61 * @since S60 3.2 |
60 * Construct a CCSXHHelpContentBase |
62 * Construct a CCSXHHelpContentBase |
61 * @param aName - Name |
63 * @param aName - Name |
62 */ |
64 */ |
63 CCSXHHelpContentBase(const TDesC& name); |
65 CCSXHHelpContentBase(const TDesC& name, const TInt32 aPriority = 0); |
64 |
66 |
65 private: |
67 private: |
66 // 1. For Generic TOC1: The TOC1 entry name |
68 // 1. For Generic TOC1: The TOC1 entry name |
67 // 2. For Generic TOC2: The TOC2 entry name |
69 // 2. For Generic TOC2: The TOC2 entry name |
68 // 3. For help database: Unused |
70 // 3. For help database: Unused |
69 //TBuf<KMaxHelpTopicName> iName; |
71 //TBuf<KMaxHelpTopicName> iName; |
70 //typedef TBuf<30> TCoeContextName; |
72 //typedef TBuf<30> TCoeContextName; |
71 |
73 |
72 HBufC *iName; |
74 HBufC *iName; |
|
75 TInt32 iPriority; |
73 |
76 |
74 template <class T> |
77 template <class T> |
75 friend TInt Orderer(const T& left, const T& right); |
78 friend TInt Orderer(const T& left, const T& right); |
76 |
79 |
|
80 template <class T> |
|
81 friend TInt OrdererWithPriority(const T& left, const T& right); |
77 }; |
82 }; |
78 /** |
83 /** |
79 * @function Orderer |
84 * @function Orderer |
80 * @since S60 3.2 |
85 * @since S60 3.2 |
81 * template function used to compare between two objects |
86 * template function used to compare between two objects |
85 */ |
90 */ |
86 template <class T> |
91 template <class T> |
87 TInt Orderer(const T& left, const T& right) |
92 TInt Orderer(const T& left, const T& right) |
88 { |
93 { |
89 //return left.GetName().CompareC(right.GetName()); |
94 //return left.GetName().CompareC(right.GetName()); |
90 return (left.iName)->CompareC(*right.iName); |
95 return (left.iName)->CompareF(*right.iName); |
91 } |
96 } |
|
97 |
|
98 template <class T> |
|
99 TInt OrdererWithPriority(const T& left, const T& right) |
|
100 { |
|
101 if (left.iPriority < right.iPriority) |
|
102 { |
|
103 return -1; |
|
104 } |
|
105 else if (left.iPriority == right.iPriority) |
|
106 { |
|
107 return (left.iName)->CompareF(*right.iName); |
|
108 } |
|
109 else |
|
110 { |
|
111 return 1; |
|
112 } |
|
113 } |
|
114 |
92 |
115 |
93 #endif /* INC_CSXHHELPCONTENTBASE_H_HEADER_INCLUDED_BC0553D0 */ |
116 #endif /* INC_CSXHHELPCONTENTBASE_H_HEADER_INCLUDED_BC0553D0 */ |