1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/downloads/SQLFunctions.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +/* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : 1.5 + * This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef mozilla_downloads_SQLFunctions_h 1.10 +#define mozilla_downloads_SQLFunctions_h 1.11 + 1.12 +#include "mozIStorageFunction.h" 1.13 +#include "mozilla/Attributes.h" 1.14 + 1.15 +class nsCString; 1.16 +class mozIStorageConnection; 1.17 + 1.18 +namespace mozilla { 1.19 +namespace downloads { 1.20 + 1.21 +/** 1.22 + * SQL function to generate a GUID for a place or bookmark item. This is just 1.23 + * a wrapper around GenerateGUID in SQLFunctions.cpp. 1.24 + * 1.25 + * @return a guid for the item. 1.26 + * @see toolkit/components/places/SQLFunctions.h - keep this in sync 1.27 + */ 1.28 +class GenerateGUIDFunction MOZ_FINAL : public mozIStorageFunction 1.29 +{ 1.30 +public: 1.31 + NS_DECL_THREADSAFE_ISUPPORTS 1.32 + NS_DECL_MOZISTORAGEFUNCTION 1.33 + 1.34 + /** 1.35 + * Registers the function with the specified database connection. 1.36 + * 1.37 + * @param aDBConn 1.38 + * The database connection to register with. 1.39 + */ 1.40 + static nsresult create(mozIStorageConnection *aDBConn); 1.41 +}; 1.42 + 1.43 +nsresult GenerateGUID(nsCString& _guid); 1.44 + 1.45 +} // namespace downloads 1.46 +} // namespace mozilla 1.47 + 1.48 +#endif