Path: blob/trunk/cpp/imehandler/linux/src/ibushandler.h
2868 views
/*1Copyright 2011 WebDriver committers2Copyright 2011 Google Inc.34Licensed under the Apache License, Version 2.0 (the "License");5you may not use this file except in compliance with the License.6You may obtain a copy of the License at78http://www.apache.org/licenses/LICENSE-2.0910Unless required by applicable law or agreed to in writing, software11distributed under the License is distributed on an "AS IS" BASIS,12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13See the License for the specific language governing permissions and14limitations under the License.1516Author: [email protected]17*/1819#ifndef IBUSHANDLER_H_20#define IBUSHANDLER_H_212223#include <vector>24#include <string>2526#include "imehandler.h"2728// If ibus.h is not included, provide a forward definition29// for these classes.30#ifndef IBUS_MAJOR_VERSION31class IBusInputContext;32class IBusBus;33#endif3435/*36* Implementation of the IME handler for the linux ibus framework.37*/38class IBusHandler : public ImeHandler {39public:40IBusHandler();41virtual ~IBusHandler();42virtual std::vector<std::string> GetInstalledEngines() const;43virtual std::vector<std::string> GetAvailableEngines() const;44virtual std::string GetActiveEngine() const;45virtual bool IsActivated() const;46virtual void Deactivate();47virtual int LoadEngines(const std::vector<std::string>&);48virtual bool ActivateEngine(const std::string&);4950private:51// Methods to factorize common tasks.52IBusInputContext* GetCurrentInputContext() const;5354// The current connection to the ibus daemon.55IBusBus* bus_;5657// Is iBus available at all?58bool ibus_available_;5960DISALLOW_COPY_AND_ASSIGN(IBusHandler);61};626364#endif // IBUSHANDLER_H_656667