sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FBaseColIBidirectionalEnumerator.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                FBaseColIBidirectionalEnumerator.h
20  * @brief               This is the header file for the %IBidirectionalEnumerator interface.
21  *
22  * This header file contains the declarations of the %IBidirectionalEnumerator interface.
23  *
24  */
25 #ifndef _FBASE_COL_IBIDIRECTIONAL_ENUMERATOR_H_
26 #define _FBASE_COL_IBIDIRECTIONAL_ENUMERATOR_H_
27
28 #include <FBaseColIEnumerator.h>
29
30
31 namespace Tizen { namespace Base { namespace Collection
32 {
33
34 /**
35  * @interface IBidirectionalEnumerator
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 %IBidirectionalEnumerator interface supports a bidirectional iteration over a collection.
46  *      One can only access the elements in a collection through %IBidirectionalEnumerator. The elements cannot be modified through this interface.
47  */
48 class _OSP_EXPORT_ IBidirectionalEnumerator
49         : public virtual IEnumerator
50 {
51 public:
52         /**
53          * This polymorphic destructor should be overridden if required. @n
54          * This way, the destructors of the derived classes are called when the destructor of this interface is called.
55          *
56          * @since 2.0
57          */
58         virtual ~IBidirectionalEnumerator(void) {}
59
60         /**
61          * Moves %IBidirectionalEnumerator to the previous element of the collection. @n
62          * A call to the MovePrevious() method after the ResetLast() method positions the enumerator to the last element in the collection.
63          *
64          * @since 2.0
65          *
66          * @return              An error code
67          * @exception   E_SUCCESS                       The method is successful.
68          * @exception   E_OUT_OF_RANGE          The enumerator has passed the front of the collection.
69          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation, or
70          *                                                                      the collection is modified after the enumerator is created.
71          * @see                 Tizen::Base::Collection::IEnumerator::MoveNext()
72          * @see                 ResetLast()
73          */
74         virtual result MovePrevious(void) = 0;
75
76         /**
77          * Positions the enumerator after the last element in the collection.
78          *
79          * @since 2.0
80          *
81          * @return              An error code
82          * @exception   E_SUCCESS                       The method is successful.
83          * @exception   E_INVALID_OPERATION     The current state of the instance prohibits the execution of the specified operation, or
84          *                                                                      the collection is modified after the enumerator is created.
85          * @see                 Tizen::Base::Collection::IEnumerator::Reset()
86          * @see                 MovePrevious()
87          */
88         virtual result ResetLast(void) = 0;
89
90 protected:
91         //
92         // This method is for internal use only. Using this method can cause behavioral, security-related,
93         // and consistency-related issues in the application.
94         //
95         // This method is reserved and may change its name at any time without prior notice.
96         //
97         // @since 2.0
98         //
99         virtual void IBidirectionalEnumerator_Reserved1(void) { }
100
101         //
102         // This method is for internal use only. Using this method can cause behavioral, security-related,
103         // and consistency-related issues in the application.
104         //
105         // This method is reserved and may change its name at any time without prior notice.
106         //
107         // @since 2.0
108         //
109         virtual void IBidirectionalEnumerator_Reserved2(void) { }
110
111 }; // IBidirectionalEnumerator
112
113 }}} // Tizen::Base::Collection
114
115 #endif // _FBASE_COL_IBIDIRECTIONAL_ENUMERATOR_H_