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