diff options
Diffstat (limited to 'lib-contact/ct-list/src/CtListModelLinkSuggest.h')
-rw-r--r-- | lib-contact/ct-list/src/CtListModelLinkSuggest.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/lib-contact/ct-list/src/CtListModelLinkSuggest.h b/lib-contact/ct-list/src/CtListModelLinkSuggest.h new file mode 100644 index 0000000..73119a8 --- /dev/null +++ b/lib-contact/ct-list/src/CtListModelLinkSuggest.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2009-2015 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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 __CT_LIST_MODEL_LINK_SUGGEST_H_ +#define __CT_LIST_MODEL_LINK_SUGGEST_H_ + +#include <vector> +#include <string> +#include <functional> +#include <contacts.h> +#include <memory> +#include <Ecore.h> +#include <Elementary.h> + +#include "CtType.h" +#include "CtCommon.h" +#include "ContactsCommon.h" +#include "CtListModel.h" +#include "CtListDataPerson.h" + +class ICtChangeListener; + +class CtListModelLinkSuggest : public CtListModel +{ +public: + CtListModelLinkSuggest(const int selectedPersonId); + virtual ~CtListModelLinkSuggest(); + +public: + // CtListModel interfaces + virtual int getContactsCount(CtListQueryType queryType); + virtual int getContacts(CtListQueryType queryType, CtGetContactsType syncType); + virtual int cancelGetContacts() { return 0; } + virtual std::shared_ptr<CtListDataPerson> getAtPersonData(int index, CtListQueryType queryType); + virtual int getPersonListCount(CtListQueryType queryType); + virtual void attachListener(ICtChangeListener* listener); + + virtual void setSelectedPersonId(int selectedPersonId); + virtual const char* getSearchString(void); + virtual bool setSearchString(char* search); + virtual void getNumberSearchString(const std::shared_ptr<CtListDataPerson>& dataPerson, std::string &numberStr); + virtual int getCheckedDataCount(); + virtual int getLimitCount(); + virtual int getCurrentLinkedCount() { return 0; } + + void setOnLoadingCb(std::function<void (int, int)> loadingCb); + void resetLoadingCb(); + + std::vector<std::shared_ptr<CtListDataPerson>>* getCheckedDataList() const; + + virtual void initialOriginalCheckedIdList(); + virtual void clearOriginalCheckedIdList(); + virtual bool checkIsSelectAllOnSearching(); + virtual void initialOriginalPersonDataListSize(); + virtual void clearOriginalPersonDataListSize(); + virtual int getOriginalPersonDataListSize(); + +private: + void __setLinkContactData(int personId); + int __makePersonList(); + int __getQueryResult(); + int __makeQuery(); + +private: + ICtChangeListener* __listener; + std::vector<std::pair<int, std::shared_ptr<CtListDataPerson>>> __personDataList; + + int __selectedPersonId; + char *__selectedName; + std::vector<char *>__vcSelectedEmail; + std::vector<char *>__vcSelectedNumber; + + contacts_list_h __nameList; + contacts_list_h __emailList; + contacts_list_h __numberList; + + contacts_query_h __nameQuery; + contacts_query_h __emailQuery; + contacts_query_h __numberQuery; + +}; + +#endif + |