PageRenderTime 26ms CodeModel.GetById 16ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llfloatertranslationsettings.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 76 lines | 41 code | 10 blank | 25 comment | 0 complexity | 06d86308485671803156b70ff1b1adf3 MD5 | raw file
 1/** 
 2 * @file llfloatertranslationsettings.h
 3 * @brief Machine translation settings for chat
 4 *
 5 * $LicenseInfo:firstyear=2011&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2011, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLFLOATERTRANSLATIONSETTINGS_H
28#define LL_LLFLOATERTRANSLATIONSETTINGS_H
29
30#include "llfloater.h"
31
32class LLButton;
33class LLCheckBoxCtrl;
34class LLComboBox;
35class LLLineEditor;
36class LLRadioGroup;
37
38class LLFloaterTranslationSettings : public LLFloater
39{
40public:
41	LLFloaterTranslationSettings(const LLSD& key);
42	/*virtual*/ BOOL postBuild();
43	/*virtual*/ void onOpen(const LLSD& key);
44
45	void setBingVerified(bool ok, bool alert);
46	void setGoogleVerified(bool ok, bool alert);
47
48private:
49	std::string getSelectedService() const;
50	std::string getEnteredBingKey() const;
51	std::string getEnteredGoogleKey() const;
52	void showAlert(const std::string& msg_name) const;
53	void updateControlsEnabledState();
54	void verifyKey(int service, const std::string& key, bool alert = true);
55
56	void onEditorFocused(LLFocusableElement* control);
57	void onBingKeyEdited();
58	void onGoogleKeyEdited();
59	void onBtnBingVerify();
60	void onBtnGoogleVerify();
61	void onBtnOK();
62
63	LLCheckBoxCtrl* mMachineTranslationCB;
64	LLComboBox* mLanguageCombo;
65	LLLineEditor* mBingAPIKeyEditor;
66	LLLineEditor* mGoogleAPIKeyEditor;
67	LLRadioGroup* mTranslationServiceRadioGroup;
68	LLButton* mBingVerifyBtn;
69	LLButton* mGoogleVerifyBtn;
70	LLButton* mOKBtn;
71
72	bool mBingKeyVerified;
73	bool mGoogleKeyVerified;
74};
75
76#endif // LL_LLFLOATERTRANSLATIONSETTINGS_H