1 /* 2 * Copyright (C) 2018 Damir Porobic <damir.porobic@gmx.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License as published by 6 * the Free Software Foundation; either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef KIMAGEANNOTATOR_WIDGETCONFIGURATORSWITCHER_H 21 #define KIMAGEANNOTATOR_WIDGETCONFIGURATORSWITCHER_H 22 23 #include <QWidget> 24 25 #include "src/common/enum/Tools.h" 26 #include "src/widgets/settingsPicker/ColorPicker.h" 27 #include "src/widgets/settingsPicker/FillModePicker.h" 28 #include "src/widgets/ToolPicker.h" 29 #include "src/widgets/settingsPicker/NumberPicker.h" 30 #include "src/widgets/settingsPicker/StickerPicker.h" 31 #include "src/widgets/settingsPicker/BoolPicker.h" 32 #include "src/widgets/settingsPicker/FontPicker.h" 33 34 namespace kImageAnnotator { 35 36 class ItemSettingsWidgetConfigurator 37 { 38 public: 39 explicit ItemSettingsWidgetConfigurator(); 40 ~ItemSettingsWidgetConfigurator() = default; 41 void setCurrentTool(Tools tool); 42 void setColorWidget(ColorPicker *widget); 43 void setTextColorWidget(ColorPicker *widget); 44 void setWidthWidget(NumberPicker *widget); 45 void setFillTypeWidget(FillModePicker *widget); 46 void setFirstNumberWidget(NumberPicker *widget); 47 void setObfuscateFactorWidget(NumberPicker *widget); 48 void setStickerWidget(StickerPicker *widget); 49 void setShadowWidget(BoolPicker *widget); 50 void setFontWidget(FontPicker *widget); 51 52 private: 53 Tools mCurrentTool; 54 ColorPicker *mColorWidget; 55 ColorPicker *mTextColorWidget; 56 NumberPicker *mWidthWidget; 57 FillModePicker *mFillModeWidget; 58 NumberPicker *mFirstNumberWidget; 59 NumberPicker *mObfuscateFactorWidget; 60 StickerPicker *mStickerWidget; 61 BoolPicker *mShadowPicker; 62 FontPicker *mFontPicker; 63 64 void updateWidgets() const; 65 void updateProperties() const; 66 void updateVisibility() const; 67 void setColorWidgetVisible(bool enabled) const; 68 void setTextColorWidgetVisible(bool enabled) const; 69 void setWidthWidgetVisible(bool enabled) const; 70 void setFillWidgetVisible(bool enabled) const; 71 void setFirstNumberWidgetVisible(bool enabled) const; 72 void setNoFillAndNoBorderVisible(bool enabled) const; 73 void setObfuscateFactorWidgetVisible(bool enabled) const; 74 void setStickerWidgetVisible(bool enabled) const; 75 void setShadowWidgetVisible(bool enabled) const; 76 void setFontWidgetVisible(bool enabled) const; 77 void setWidthRange(int min, int max) const; 78 }; 79 80 } // namespace kImageAnnotator 81 82 #endif // KIMAGEANNOTATOR_WIDGETCONFIGURATORSWITCHER_H 83