OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 68 |
69 // Authenticates the user by fetching the auth token as | 69 // Authenticates the user by fetching the auth token as |
70 // needed. |callback| will be run with the error code and the auth | 70 // needed. |callback| will be run with the error code and the auth |
71 // token, on the thread this function is run. | 71 // token, on the thread this function is run. |
72 virtual void Authenticate(const AuthStatusCallback& callback) = 0; | 72 virtual void Authenticate(const AuthStatusCallback& callback) = 0; |
73 | 73 |
74 // Fetches the document feed from |feed_url| with |start_changestamp|. If this | 74 // Fetches the document feed from |feed_url| with |start_changestamp|. If this |
75 // URL is empty, the call will fetch the default root or change document feed. | 75 // URL is empty, the call will fetch the default root or change document feed. |
76 // |start_changestamp| specifies the starting point from change feeds only. | 76 // |start_changestamp| specifies the starting point from change feeds only. |
77 // Value different than 0, it would trigger delta feed fetching. | 77 // Value different than 0, it would trigger delta feed fetching. |
78 // |search_query| specifies search query to be sent to the server. It will be | |
79 // used only if |start_changestamp| is 0. | |
satorux1
2012/05/03 17:58:34
If we don't want to search, can we just pass an em
tbarzic
2012/05/03 23:56:17
Done.
| |
78 // Upon completion, invokes |callback| with results on the calling thread. | 80 // Upon completion, invokes |callback| with results on the calling thread. |
79 virtual void GetDocuments(const GURL& feed_url, | 81 virtual void GetDocuments(const GURL& feed_url, |
80 int start_changestamp, | 82 int start_changestamp, |
83 const std::string& search_query, | |
81 const GetDataCallback& callback) = 0; | 84 const GetDataCallback& callback) = 0; |
82 | 85 |
83 // Gets the account metadata from the server using the default account | 86 // Gets the account metadata from the server using the default account |
84 // metadata URL. Upon completion, invokes |callback| with results on the | 87 // metadata URL. Upon completion, invokes |callback| with results on the |
85 // calling thread. | 88 // calling thread. |
86 virtual void GetAccountMetadata(const GetDataCallback& callback) = 0; | 89 virtual void GetAccountMetadata(const GetDataCallback& callback) = 0; |
87 | 90 |
88 // Deletes a document identified by its 'self' |url| and |etag|. | 91 // Deletes a document identified by its 'self' |url| and |etag|. |
89 // Upon completion, invokes |callback| with results on the calling thread. | 92 // Upon completion, invokes |callback| with results on the calling thread. |
90 virtual void DeleteDocument(const GURL& document_url, | 93 virtual void DeleteDocument(const GURL& document_url, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 DocumentsService(); | 174 DocumentsService(); |
172 virtual ~DocumentsService(); | 175 virtual ~DocumentsService(); |
173 | 176 |
174 // DocumentsServiceInterface Overrides | 177 // DocumentsServiceInterface Overrides |
175 virtual void Initialize(Profile* profile) OVERRIDE; | 178 virtual void Initialize(Profile* profile) OVERRIDE; |
176 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; | 179 virtual GDataOperationRegistry* operation_registry() const OVERRIDE; |
177 virtual void CancelAll() OVERRIDE; | 180 virtual void CancelAll() OVERRIDE; |
178 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; | 181 virtual void Authenticate(const AuthStatusCallback& callback) OVERRIDE; |
179 virtual void GetDocuments(const GURL& feed_url, | 182 virtual void GetDocuments(const GURL& feed_url, |
180 int start_changestamp, | 183 int start_changestamp, |
184 const std::string& search_query, | |
181 const GetDataCallback& callback) OVERRIDE; | 185 const GetDataCallback& callback) OVERRIDE; |
182 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; | 186 virtual void GetAccountMetadata(const GetDataCallback& callback) OVERRIDE; |
183 virtual void DeleteDocument(const GURL& document_url, | 187 virtual void DeleteDocument(const GURL& document_url, |
184 const EntryActionCallback& callback) OVERRIDE; | 188 const EntryActionCallback& callback) OVERRIDE; |
185 virtual void DownloadDocument( | 189 virtual void DownloadDocument( |
186 const FilePath& virtual_path, | 190 const FilePath& virtual_path, |
187 const FilePath& local_cache_path, | 191 const FilePath& local_cache_path, |
188 const GURL& content_url, | 192 const GURL& content_url, |
189 DocumentExportFormat format, | 193 DocumentExportFormat format, |
190 const DownloadActionCallback& callback) OVERRIDE; | 194 const DownloadActionCallback& callback) OVERRIDE; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 scoped_ptr<GDataOperationRegistry> operation_registry_; | 251 scoped_ptr<GDataOperationRegistry> operation_registry_; |
248 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; | 252 base::WeakPtrFactory<DocumentsService> weak_ptr_factory_; |
249 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; | 253 base::WeakPtr<DocumentsService> weak_ptr_bound_to_ui_thread_; |
250 | 254 |
251 DISALLOW_COPY_AND_ASSIGN(DocumentsService); | 255 DISALLOW_COPY_AND_ASSIGN(DocumentsService); |
252 }; | 256 }; |
253 | 257 |
254 } // namespace gdata | 258 } // namespace gdata |
255 | 259 |
256 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ | 260 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOCUMENTS_SERVICE_H_ |
OLD | NEW |