-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic interface for candidate action.
- Loading branch information
Showing
7 changed files
with
179 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024-2024 CSSlayer <[email protected]> | ||
* | ||
* SPDX-License-Identifier: LGPL-2.1-or-later | ||
* | ||
*/ | ||
#include "candidateaction.h" | ||
#include "fcitx-utils/macros.h" | ||
|
||
namespace fcitx { | ||
|
||
class CandidateActionPrivate { | ||
public: | ||
CandidateActionPrivate() = default; | ||
FCITX_INLINE_DEFINE_DEFAULT_DTOR_COPY_AND_MOVE_WITHOUT_SPEC( | ||
CandidateActionPrivate); | ||
|
||
int id_ = 0; | ||
std::string text_; | ||
bool isSeparator_ = false; | ||
std::string icon_; | ||
bool isCheckable_ = false; | ||
bool isChecked_ = false; | ||
}; | ||
|
||
CandidateAction::CandidateAction() | ||
: d_ptr(std::make_unique<CandidateActionPrivate>()) {} | ||
|
||
FCITX_DEFINE_DPTR_COPY_AND_DEFAULT_DTOR_AND_MOVE(CandidateAction); | ||
|
||
FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, int, id, setId); | ||
FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, std::string, text, setText); | ||
FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, bool, isSeparator, setSeparator); | ||
FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, std::string, icon, setIcon); | ||
FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, bool, isCheckable, setCheckable); | ||
FCITX_DEFINE_PROPERTY_PRIVATE(CandidateAction, bool, isChecked, setChecked); | ||
|
||
} // namespace fcitx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024-2024 CSSlayer <[email protected]> | ||
* | ||
* SPDX-License-Identifier: LGPL-2.1-or-later | ||
* | ||
*/ | ||
#ifndef _FCITX_CANDIDATEACTION_H_ | ||
#define _FCITX_CANDIDATEACTION_H_ | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <fcitx-utils/macros.h> | ||
#include "fcitxcore_export.h" | ||
|
||
namespace fcitx { | ||
|
||
class CandidateActionPrivate; | ||
|
||
class FCITXCORE_EXPORT CandidateAction { | ||
public: | ||
CandidateAction(); | ||
virtual ~CandidateAction(); | ||
FCITX_DECLARE_COPY_AND_MOVE(CandidateAction); | ||
|
||
FCITX_DECLARE_PROPERTY(int, id, setId); | ||
FCITX_DECLARE_PROPERTY(std::string, text, setText); | ||
FCITX_DECLARE_PROPERTY(bool, isSeparator, setSeparator); | ||
FCITX_DECLARE_PROPERTY(std::string, icon, setIcon); | ||
FCITX_DECLARE_PROPERTY(bool, isCheckable, setCheckable); | ||
FCITX_DECLARE_PROPERTY(bool, isChecked, setChecked); | ||
|
||
private: | ||
FCITX_DECLARE_PRIVATE(CandidateAction); | ||
std::unique_ptr<CandidateActionPrivate> d_ptr; | ||
}; | ||
|
||
} // namespace fcitx | ||
|
||
#endif // _FCITX_CANDIDATEACTION_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters