summaryrefslogtreecommitdiff
path: root/lib/dialer/Search/Result.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dialer/Search/Result.h')
-rw-r--r--lib/dialer/Search/Result.h112
1 files changed, 0 insertions, 112 deletions
diff --git a/lib/dialer/Search/Result.h b/lib/dialer/Search/Result.h
deleted file mode 100644
index 6bc8b1a..0000000
--- a/lib/dialer/Search/Result.h
+++ /dev/null
@@ -1,112 +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 __PHONE_DIALER_SEARCH_RESULT_H__
-#define __PHONE_DIALER_SEARCH_RESULT_H__
-
-#include <vector>
-#include <string>
-
-#include "Contact.h"
-#include "SharedPtr.h"
-
-namespace Phone
-{
- namespace Dialer
- {
- namespace Search
- {
- typedef Utils::SharedPtr<Common::Contact> ContactPtr;
-
- /*
- * @brief Dialer search result data
- */
- class Result
- {
- public:
- /*
- * @brief Specifies by which field contact data matches search query
- */
- enum MatchType
- {
- ByNumber,
- ByName
- };
-
- Result();
- Result(const Result &result);
- Result(const ContactPtr &contact, MatchType matchType,
- size_t matchPos, size_t matchLength);
-
- /*
- * @return Type of the result
- * @see Result::MatchType
- */
- MatchType getMatchType() const;
-
- /*
- * @return Contact data associated with result
- */
- const ContactPtr & getContact() const;
-
- /*
- * @return Start position of the match in matched string
- */
- size_t getMatchPos() const;
-
- /*
- * @return Length of matched substring (i.e. length of search query)
- */
- size_t getMatchLength() const;
-
- /*
- * @brief Format matched field by prepending matchBegin
- * and appending matchEnd strings to the matching substring.
- * @par example
- * If contact's number is "1234567" and search query is "34"
- * then the following code:
- *
- * @code
- * std::string match;
- * result.formatMatch(match, "<match>", "</>");
- * @endcode
- *
- * will write "12<match>34</>567" in "match" string
- *
- * @param[out] formattedMatch Formatted match string
- * @param[in] matchBegin String to prepend matching substring with
- * @param[in] matchEnd String to append to matching substring
- * @return true on success, false otherwise
- */
- bool formatMatch(std::string &formattedMatch,
- const std::string &matchBegin,
- const std::string &matchEnd) const;
-
- Result & operator=(const Result &result);
-
- private:
- ContactPtr m_Contact;
- MatchType m_MatchType;
- size_t m_MatchPos;
- size_t m_MatchLength;
- };
-
- typedef std::vector<Result> Results;
- }
- }
-}
-
-#endif /* __PHONE_DIALER_SEARCH_RESULT_H__ */