Fcitx
inputcontextproperty.cpp
1 /*
2  * SPDX-FileCopyrightText: 2017-2017 CSSlayer <wengxt@gmail.com>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 #include "inputcontextmanager.h"
8 #include "inputcontextproperty_p.h"
9 
10 namespace fcitx {
11 
12 InputContextPropertyFactory::InputContextPropertyFactory()
13  : d_ptr(std::make_unique<InputContextPropertyFactoryPrivate>(this)) {}
14 
15 InputContextPropertyFactory::~InputContextPropertyFactory() { unregister(); }
16 
18  FCITX_D();
19  return d->manager_;
20 }
21 
23  FCITX_D();
24  if (d->manager_) {
25  d->manager_->unregisterProperty(d->name_);
26  }
27 }
28 } // namespace fcitx
Definition: action.cpp:17
Definition: matchrule.h:78
bool registered() const
Return whether the factory is already registered with an InputContextManager.
void unregister()
Unregister the factory from current InputContextManager.