Merge "Apply millisecond of DateTime for Calendar" into tizen_2.1
[platform/framework/native/appfw.git] / inc / FBaseColIBidirectionalEnumeratorT.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FBaseColIBidirectionalEnumeratorT.h
20  * @brief               This is the header file for the %IBidirectionalEnumeratorT interface.
21  *
22  * This header file contains the declarations of the %IBidirectionalEnumeratorT interface.
23  *
24  */
25 #ifndef _FBASE_COL_IBIDIRECTIONAL_ENUMERATOR_T_H_
26 #define _FBASE_COL_IBIDIRECTIONAL_ENUMERATOR_T_H_
27
28 #include <FBaseColIEnumeratorT.h>
29
30
31 namespace Tizen { namespace Base { namespace Collection
32 {
33
34 /**
35  * @interface IBidirectionalEnumeratorT
36  * @brief       This interface supports a bidirectional iteration over a collection.
37  *
38  * @since 2.0
39  *
40  * @remarks
41  * An enumerator remains valid as long as the collection remains unchanged.
42  * If changes are made to the collection, such as adding, modifying, or
43  * deleting elements, the enumerator is irrecoverably invalidated. The next call to GetCurrent(), MoveNext(), MovePrevious(), Reset(), or ResetLast() fails (E_INVALID_OPERATION).
44  *
45  * The %IBidirectionalEnumeratorT interface supports a bidirectional iteration over a collection.
46  *      One can only access the elements in a collection through %IBidirectionalEnumeratorT. The elements cannot be modified through this interface.
47  *
48  */
49 template< class Type >
50 class IBidirectionalEnumeratorT
51         : public virtual IEnumeratorT< Type >
52 {
53 public:
54         /**
55          * This polymorphic destructor should be overridden if required. @n
56          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
57          *
58          * @since 2.0
59          */
60         virtual ~IBidirectionalEnumeratorT(void) {}
61
62         /**
63          * Moves %IBidirectionalEnumeratorT to the previous element of the collection. @n
64          * A call to the MovePrevious() method after the ResetLast() method positions the enumerator to the last element in the collection.
65          *
66          * @since 2.0
67          *
68          * @return              An error code
69          * @exception   E_SUCCESS                       The method is successful.
70          * @exception   E_OUT_OF_RANGE          The enumerator has passed the front of the collection.
71          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation, or
72          *                                                                      the collection is modified after the enumerator is created.
73          * @see                 Tizen::Base::Collection::IEnumeratorT< Type >::MoveNext()
74          * @see                 ResetLast()
75          */
76         virtual result MovePrevious(void) = 0;
77
78         /**
79          * Positions the enumerator after the last element in the collection.
80          *
81          * @since 2.0
82          *
83          * @return              An error code
84          * @exception   E_SUCCESS                       The method is successful.
85          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation, or
86          *                                                                      the collection is modified after the enumerator is created.
87          * @see                 Tizen::Base::Collection::IEnumeratorT< Type >::Reset()
88          * @see                 MovePrevious()
89          */
90         virtual result ResetLast(void) = 0;
91
92 }; // IBidirectionalEnumeratorT
93
94 }}} // Tizen::Base::Collection
95
96 #endif // _FBASE_COL_I_BIDIRECTIONAL_ENUMERATOR_T_H_