summaryrefslogtreecommitdiff
path: root/lib/common/Database/Database.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/Database/Database.h')
-rw-r--r--lib/common/Database/Database.h96
1 files changed, 0 insertions, 96 deletions
diff --git a/lib/common/Database/Database.h b/lib/common/Database/Database.h
deleted file mode 100644
index 15324eb..0000000
--- a/lib/common/Database/Database.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2012-2013 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __DATABASE_DATABASE_H__
-#define __DATABASE_DATABASE_H__
-
-#include "NonCopyable.h"
-
-namespace Database
-{
- class Listener;
- /*
- * @brief Contacts database connection class.
- * @remarks Database connection is automatically closed on destruction.
- */
- class Database : public Utils::NonCopyable
- {
- public:
- /*
- * @return Database instance
- */
- static Database & getInstance();
-
- /*
- * @brief Connect to database.
- * @return true on success, false otherwise
- */
- bool connect();
-
- /*
- * @brief Disconnect from database.
- * @return true on success, false otherwise
- */
- bool disconnect();
-
- /*
- * @return true if connection is established, false otherwise
- */
- bool isConnected() const;
-
- /*
- * @brief Listen for changes in specified database view (table)
- * @remarks Always remove added listeners by calling removeListener
- *
- * @param uri Database view URI
- * @param listener Database listener
- * @return true if listener successfully added, false otherwise
- * @see Database::Listener
- */
- bool addListener(const char *uri, Listener *listener);
-
- /*
- * @brief Remove previously added database listener
- * @warning Not removing listeners before their destruction
- * can render your application not workable until contacts service restart
- *
- * @param uri Database view URI
- * @param listener Database listener
- * @return true if listener successfully removed, false otherwise
- */
- bool removeListener(const char *uri, Listener *listener);
-
- /*
- * @brief Determine whether result code indicates success.
- * @remarks If result code indicates error,
- * an error message will be written to logs.
- *
- * @param result Contacts database API error code
- * @return true on success, false otherwise
- */
- static bool isSuccess(int result);
-
- private:
- Database();
- ~Database();
-
- static void onChange(const char *uri, char *changes, void *data);
-
- bool m_IsConnected;
- };
-}
-
-#endif /* __DATABASE_DATABASE_H__ */