~aleteoryx/muditaos

ref: 196c02686ae5b344e6814800b7cb8aa2473f15ea muditaos/module-apps/application-messages/widgets/SMSInputWidget.hpp -rw-r--r-- 1.1 KiB
196c0268 — Przemyslaw Brudny [EGD-2395] Added BottomTop orientation support for listView. Created SMSThreadViewWindow and SMSOutputWidget. MessagesStyle moved from global Style.hpp. Fixes in Text. ListView fixes, BoxLayout callback for requestedSize. Added smsInput into list. Drafts handling added. 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include "Application.hpp"

#include "Text.hpp"
#include "Image.hpp"
#include "ListItem.hpp"
#include <BoxLayout.hpp>
#include "Interface/SMSRecord.hpp"

namespace gui
{

    class SMSInputWidget : public ListItem
    {
        app::Application *application = nullptr;
        HBox *body                    = nullptr;
        gui::Image *replyImage        = nullptr;

      public:
        gui::Text *inputText = nullptr;
        std::optional<SMSRecord> draft; // draft message of the thread we are showing, if exists.
        std::unique_ptr<utils::PhoneNumber::View> number = nullptr;

        SMSInputWidget(app::Application *application);
        ~SMSInputWidget() override = default;

        void handleDraftMessage();
        void clearDraftMessage();
        void updateDraftMessage(const UTF8 &inputText);
        void displayDraftMessage() const;

        auto onDimensionChanged(const BoundingBox &oldDim, const BoundingBox &newDim) -> bool override;
        auto handleRequestResize(const Item *, unsigned short request_w, unsigned short request_h) -> Size override;
    };

} /* namespace gui */