OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 int64 GetPredecessorId() const; | 184 int64 GetPredecessorId() const; |
185 | 185 |
186 // Return the ID of the node immediately after this in the sibling order. | 186 // Return the ID of the node immediately after this in the sibling order. |
187 // For the last node in the ordering, return 0. | 187 // For the last node in the ordering, return 0. |
188 int64 GetSuccessorId() const; | 188 int64 GetSuccessorId() const; |
189 | 189 |
190 // Return the ID of the first child of this node. If this node has no | 190 // Return the ID of the first child of this node. If this node has no |
191 // children, return 0. | 191 // children, return 0. |
192 int64 GetFirstChildId() const; | 192 int64 GetFirstChildId() const; |
193 | 193 |
| 194 // Returns the IDs of the children of this node. |
| 195 // If this type supports user-defined positions the returned IDs will be in |
| 196 // the correct order. |
| 197 void GetChildIds(std::vector<int64>* result) const; |
| 198 |
194 // Returns the total number of nodes including and beneath this node. | 199 // Returns the total number of nodes including and beneath this node. |
195 // Recursively iterates through all children. | 200 // Recursively iterates through all children. |
196 int GetTotalNodeCount() const; | 201 int GetTotalNodeCount() const; |
197 | 202 |
198 // These virtual accessors provide access to data members of derived classes. | 203 // These virtual accessors provide access to data members of derived classes. |
199 virtual const syncable::Entry* GetEntry() const = 0; | 204 virtual const syncable::Entry* GetEntry() const = 0; |
200 virtual const BaseTransaction* GetTransaction() const = 0; | 205 virtual const BaseTransaction* GetTransaction() const = 0; |
201 | 206 |
202 // Dumps a summary of node info into a DictionaryValue and returns it. | 207 // Dumps a summary of node info into a DictionaryValue and returns it. |
203 // Transfers ownership of the DictionaryValue to the caller. | 208 // Transfers ownership of the DictionaryValue to the caller. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 257 |
253 // Same as |unencrypted_data_|, but for legacy password encryption. | 258 // Same as |unencrypted_data_|, but for legacy password encryption. |
254 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; | 259 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; |
255 | 260 |
256 DISALLOW_COPY_AND_ASSIGN(BaseNode); | 261 DISALLOW_COPY_AND_ASSIGN(BaseNode); |
257 }; | 262 }; |
258 | 263 |
259 } // namespace syncer | 264 } // namespace syncer |
260 | 265 |
261 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 266 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
OLD | NEW |