Public Member Functions | Private Member Functions | Private Attributes
MailViewWindow Class Reference

#include <mailviewwindow.h>

Inheritance diagram for MailViewWindow:
Window ActionListener BasicContainer2 MouseListener WidgetListener BasicContainer Widget WidgetDeathListener Widget2

Public Member Functions

 MailViewWindow (MailMessage *const message, const int itemsCount)
 ~MailViewWindow ()
void action (const ActionEvent &event)
InventorygetInventory () const
void updateItems ()
void removeItems (const int64_t mailId)
void removeMoney (const int64_t mailId)
- Public Member Functions inherited from Window
 Window (const std::string &caption, const Modal modal, Window *const parent, std::string skin)
 ~Window ()
void draw (Graphics *const graphics)
void safeDraw (Graphics *const graphics)
void setContentSize (int width, int height)
void setLocationRelativeTo (const Widget *const widget)
void setLocationHorisontallyRelativeTo (const Widget *const widget)
void setLocationRelativeTo (const ImagePosition::Type &position, int offsetX, int offsetY)
void setResizable (const bool resize)
void redraw ()
void widgetResized (const Event &event)
void widgetMoved (const Event &event)
void widgetHidden (const Event &event)
void setCloseButton (const bool flag)
bool getCloseButton () const
void setAllowClose (const bool b)
bool getAlowClose () const
bool isResizable () const
void setMinWidth (const int width)
int getMinWidth () const
void setMinHeight (const int height)
int getMinHeight () const
void setMaxWidth (const int width)
int getMaxWidth () const
void setMaxHeight (const int height)
int getMaxHeight () const
void setShowTitle (bool flag)
void setStickyButton (const bool flag)
void setSticky (const bool sticky)
bool isSticky () const
void setStickyButtonLock (const bool sticky)
bool isStickyButtonLock () const
virtual void setVisible (Visible visible)
void setVisible (const Visible visible, const bool forceSticky)
bool isDefaultVisible () const
void setDefaultVisible (const bool save)
bool willSaveVisible () const
void setSaveVisible (const bool save)
void postInit ()
WindowgetParentWindow () const
virtual void scheduleDelete ()
void mousePressed (MouseEvent &event)
void mouseDragged (MouseEvent &event)
void mouseMoved (MouseEvent &event)
void mouseReleased (MouseEvent &event)
void mouseExited (MouseEvent &event)
void mouseEntered (MouseEvent &event)
void updateResizeHandler (MouseEvent &event)
void setWindowName (const std::string &name)
const std::string & getWindowName () const
void loadWindowState ()
void saveWindowState ()
void setDefaultSize (const int defaultX, const int defaultY, int defaultWidth, int defaultHeight)
void setDefaultSize ()
void setDefaultSize (const int defaultWidth, const int defaultHeight, const ImagePosition::Type &position, const int offsetx, const int offsetY)
virtual void resetToDefaultSize ()
void adjustPositionAfterResize (const int oldScreenWidth, const int oldScreenHeight)
LayoutgetLayout ()
void clearLayout ()
void reflowLayout (int w, int h)
LayoutCellplace (const int x, const int y, Widget *const wg, const int w, const int h)
ContainerPlacer getPlacer (const int x, const int y)
void center ()
void centerHorisontally ()
virtual void close ()
void setModal (const Modal modal)
Rect getWindowArea () const
bool isResizeAllowed (const MouseEvent &event) const
void setCaptionFont (Font *font)
void enableVisibleSound (bool b)
bool isWindowVisible () const
void setPadding (int padding)
int getPadding () const
void setTitleBarHeight (unsigned int height)
unsigned int getTitleBarHeight () const
void setCaption (const std::string &caption)
const std::string & getCaption () const
void setAlignment (Graphics::Alignment alignment)
Graphics::Alignment getAlignment () const
void setMovable (Move movable)
bool isMovable () const
Rect getChildrenArea ()
virtual void resizeToContent ()
- Public Member Functions inherited from BasicContainer2
 BasicContainer2 (const Widget2 *const widget)
 ~BasicContainer2 ()
void setOpaque (Opaque opaque)
bool isOpaque () const
virtual void add (Widget *const widget)
void addXY (Widget *const widget, const int x, const int y)
- Public Member Functions inherited from BasicContainer
 BasicContainer (const Widget2 *const widget)
 ~BasicContainer ()
void showWidgetPart (Widget *const widget, const Rect &area)
void moveToTop (Widget *const widget)
void moveToBottom (Widget *const widget)
void focusNext ()
void focusPrevious ()
void logic ()
void setFocusHandler (FocusHandler *const focusHandler)
void setInternalFocusHandler (FocusHandler *const focusHandler)
WidgetgetWidgetAt (int x, int y)
void death (const Event &event)
WidgetfindFirstWidget (const std::set< Widget *> &list)
void add (Widget *const widget)
virtual void remove (Widget *const widget)
virtual void clear ()
- Public Member Functions inherited from Widget
 Widget (const Widget2 *const widget)
 ~Widget ()
virtual void drawFrame (Graphics *graphics)
virtual void safeDrawFrame (Graphics *graphics)
void setFrameSize (const unsigned int frameSize)
unsigned int getFrameSize () const
WidgetgetParent () const
void setWidth (const int width)
int getWidth () const
void setHeight (const int height)
int getHeight () const
void setSize (const int width, const int height)
void setX (const int x)
int getX () const
void setY (const int y)
int getY () const
void setPosition (const int x, const int y)
void setDimension (const Rect &dimension)
const RectgetDimension () const
void setFocusable (const bool focusable)
bool isFocusable () const
virtual bool isFocused () const
void setEnabled (const bool enabled)
bool isEnabled () const
void setVisible (Visible visible)
bool isVisible () const
void setBaseColor (const Color &color)
const ColorgetBaseColor () const
void setForegroundColor (const Color &color)
const ColorgetForegroundColor () const
void setBackgroundColor (const Color &color)
const ColorgetBackgroundColor () const
virtual void requestFocus ()
virtual void requestMoveToTop ()
virtual void requestMoveToBottom ()
FocusHandlergetFocusHandler ()
void addActionListener (ActionListener *const actionListener)
void removeActionListener (ActionListener *const actionListener)
void addDeathListener (WidgetDeathListener *const deathListener)
void removeDeathListener (WidgetDeathListener *const deathListener)
void addMouseListener (MouseListener *const mouseListener)
void removeMouseListener (MouseListener *const mouseListener)
void addKeyListener (KeyListener *const keyListener)
void removeKeyListener (KeyListener *const keyListener)
void addFocusListener (FocusListener *const focusListener)
void removeFocusListener (FocusListener *const focusListener)
void addWidgetListener (WidgetListener *const widgetListener)
void removeWidgetListener (WidgetListener *const widgetListener)
void setActionEventId (const std::string &actionEventId)
const std::string & getActionEventId () const
virtual void getAbsolutePosition (int &x, int &y) const
virtual void setParent (Widget *parent)
FontgetFont () const
void setFont (Font *const font)
virtual void fontChanged ()
bool isTabInEnabled () const
void setTabInEnabled (const bool enabled)
bool isTabOutEnabled () const
void setTabOutEnabled (const bool enabled)
void requestModalFocus ()
virtual void requestModalMouseInputFocus ()
virtual void releaseModalFocus ()
virtual void releaseModalMouseInputFocus ()
virtual bool isModalFocused () const
virtual bool isModalMouseInputFocused () const
const std::list< MouseListener * > & getMouseListeners () const A_CONST
const std::list< KeyListener * > & getKeyListeners () const A_CONST
const std::list< FocusListener * > & getFocusListeners () const A_CONST
virtual FocusHandlergetInternalFocusHandler ()
void setInternalFocusHandler (FocusHandler *const internalFocusHandler)
void setId (const std::string &id)
const std::string & getId () const
virtual void showPart (const Rect &rectangle)
bool isAllowLogic () const
void setMouseConsume (const bool b)
bool isMouseConsume () const
void setRedraw (const bool b)
virtual bool isSelectable () const
void setSelectable (const bool selectable)
void windowResized ()
- Public Member Functions inherited from Widget2
virtual ~Widget2 ()
const ColorgetThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
const ColorgetThemeCharColor (const signed char c, bool &valid) const A_INLINE
virtual void setWidget2 (const Widget2 *const widget)
void setPalette (int palette)
void checkPalette ()
void setForegroundColor2 (const Color &color)
WidgetgetWindow () const
virtual void setWindow (Widget *const window)
- Public Member Functions inherited from WidgetDeathListener
virtual ~WidgetDeathListener ()
- Public Member Functions inherited from MouseListener
virtual ~MouseListener ()
virtual void mouseClicked (MouseEvent &event)
virtual void mouseWheelMovedUp (MouseEvent &event)
virtual void mouseWheelMovedDown (MouseEvent &event)
- Public Member Functions inherited from WidgetListener
virtual ~WidgetListener ()
virtual void widgetShown (const Event &event)
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()

Private Member Functions

void updateAttachButton ()

Private Attributes

bool mUseMail2

Additional Inherited Members

- Static Public Member Functions inherited from Window
static void setWindowContainer (WindowContainer *const windowContainer)
- Static Public Member Functions inherited from Widget
static void setGlobalFont (Font *const font)
static FontgetGloablFont ()
static void cleanGlobalFont ()
static bool widgetExists (const Widget *const widget)
static void distributeWindowResizeEvent ()
static WidgetcallPostInit (Widget *const widget)
- Data Fields inherited from Widget
Visible mVisible
- Protected Types inherited from BasicContainer
typedef std::vector< Widget * > WidgetList
typedef WidgetList::iterator WidgetListIterator
typedef WidgetList::const_iterator WidgetListConstIterator
typedef WidgetList::reverse_iterator WidgetListReverseIterator
typedef WidgetList::const_reverse_iterator WidgetListCReverseIterator
- Protected Types inherited from Widget
typedef std::list< MouseListener * > MouseListenerList
typedef MouseListenerList::iterator MouseListenerIterator
typedef std::list< KeyListener * > KeyListenerList
typedef KeyListenerList::iterator KeyListenerIterator
typedef std::list< ActionListener * > ActionListenerList
typedef ActionListenerList::iterator ActionListenerIterator
typedef std::list< WidgetDeathListener * > WidgetDeathListenerList
typedef WidgetDeathListenerList::iterator WidgetDeathListenerIterator
typedef std::list< FocusListener * > FocusListenerList
typedef FocusListenerList::iterator FocusListenerIterator
typedef std::list< WidgetListener * > WidgetListenerList
typedef WidgetListenerList::iterator WidgetListenerIterator
- Protected Member Functions inherited from Window
bool canMove () const
int getOption (const std::string &name, const int def) const
bool getOptionBool (const std::string &name, const bool def) const
void setTitlePadding (const int p)
int getTitlePadding () const
- Protected Member Functions inherited from BasicContainer
virtual void drawChildren (Graphics *const graphics)
virtual void safeDrawChildren (Graphics *const graphics)
virtual void logicChildren ()
- Protected Member Functions inherited from Widget
void distributeActionEvent ()
void distributeResizedEvent ()
void distributeMovedEvent ()
void distributeHiddenEvent ()
void distributeShownEvent ()
- Protected Member Functions inherited from Widget2
 Widget2 (const Widget2 *const widget)
- Protected Member Functions inherited from WidgetDeathListener
 WidgetDeathListener ()
- Protected Member Functions inherited from MouseListener
 MouseListener ()
- Protected Member Functions inherited from WidgetListener
 WidgetListener ()
- Protected Member Functions inherited from ActionListener
 ActionListener ()
- Protected Attributes inherited from Window
std::string mCaption
Graphics::Alignment mAlignment
int mPadding
unsigned int mTitleBarHeight
Move mMovable
int mDragOffsetX
int mDragOffsetY
bool mMoved
int mDefaultX
int mDefaultY
int mDefaultWidth
int mDefaultHeight
int mCaptionOffsetX
int mCaptionOffsetY
bool mShowTitle
bool mLastRedraw
- Protected Attributes inherited from BasicContainer2
Opaque mOpaque
- Protected Attributes inherited from BasicContainer
WidgetList mWidgets
WidgetList mLogicWidgets
- Protected Attributes inherited from Widget
MouseListenerList mMouseListeners
KeyListenerList mKeyListeners
ActionListenerList mActionListeners
WidgetDeathListenerList mDeathListeners
FocusListenerList mFocusListeners
WidgetListenerList mWidgetListeners
Color mForegroundColor
Color mBackgroundColor
Color mBaseColor
Rect mDimension
std::string mActionEventId
std::string mId
unsigned int mFrameSize
bool mFocusable
bool mTabIn
bool mTabOut
bool mEnabled
bool mAllowLogic
bool mMouseConsume
bool mRedraw
bool mSelectable
- Protected Attributes inherited from Widget2
int mPaletteOffset
Color mForegroundColor2
- Static Protected Attributes inherited from Widget
static FontmGlobalFont = 0

Detailed Description

Definition at line 36 of file mailviewwindow.h.

Constructor & Destructor Documentation

◆ MailViewWindow()

MailViewWindow::MailViewWindow ( MailMessage *const  message,
const int  itemsCount 

Definition at line 49 of file mailviewwindow.cpp.

References _, BUTTON_SKIN, CAST_U32, ImagePosition::CENTER, Window::center(), Window::enableVisibleSound(), Window::getPlacer(), Window::loadWindowState(), mCloseButton, mFromLabel, mGetAttachButton, mGetMoneyButton, mItemScrollArea, mMessageLabel, mMoneyLabel, mNextButton, MailMessage::money, mPrevButton, mReplyButton, mSubjectLabel, mTimeLabel, mUseMail2, Window::setCloseButton(), Window::setDefaultSize(), ScrollArea::setHeight(), ScrollArea::setHorizontalScrollPolicy(), Window::setMinHeight(), Window::setMinWidth(), Window::setResizable(), Window::setSaveVisible(), Window::setStickyButtonLock(), Window::setVisible(), Window::setWindowName(), ScrollArea::SHOW_NEVER, strprintf(), updateAttachButton(), and Visible_true.

50  :
51  // TRANSLATORS: mail view window name
52  Window(_("View mail"), Modal_false, nullptr, "mailview.xml"),
54  mMessage(message),
55  mGetAttachButton(new Button(this,
56  // TRANSLATORS: mail view attach / items button
57  settings.enableNewMailSystem ? _("Get items") : _("Get attach"),
58  "attach",
60  this)),
61  mGetMoneyButton(nullptr),
62  // TRANSLATORS: mail view window button
63  mCloseButton(new Button(this, _("Close"), "close", BUTTON_SKIN, this)),
64  mPrevButton(new Button(this, "<", "prev", BUTTON_SKIN, this)),
65  mNextButton(new Button(this, ">", "next", BUTTON_SKIN, this)),
66  // TRANSLATORS: mail view window button
67  mReplyButton(new Button(this, _("Reply"), "reply", BUTTON_SKIN, this)),
68  // TRANSLATORS: mail view window label
69  mTimeLabel(new Label(this, strprintf("%s %s", _("Time:"),
70  message->strTime.c_str()))),
71  mMoneyLabel(nullptr),
72  // TRANSLATORS: mail view window label
73  mFromLabel(new Label(this, strprintf("%s %s", _("From:"),
74  message->sender.c_str()))),
75  // TRANSLATORS: mail view window label
76  mSubjectLabel(new Label(this, strprintf("%s %s", _("Subject:"),
77  message->title.c_str()))),
78  // TRANSLATORS: mail view window label
79  mMessageLabel(new Label(this, strprintf("%s %s", _("Message:"),
80  message->text.c_str()))),
82  mItemContainer(new ItemContainer(this, mInventory, 100000,
85  fromBool(getOptionBool("showitemsbackground", false), Opaque),
86  "mailview_listbackground.xml")),
88 {
89  setWindowName("MailView");
90  setCloseButton(true);
91  setResizable(true);
92  setSaveVisible(false);
93  setStickyButtonLock(true);
96  setDefaultSize(380, 370, ImagePosition::CENTER, 0, 0);
97  setMinWidth(200);
98  setMinHeight(100);
99  center();
104  ContainerPlacer placer(nullptr, nullptr);
105  placer = getPlacer(0, 0);
107  int n = 0;
108  placer(0, n++, mTimeLabel, 1, 1);
109  placer(0, n++, mFromLabel, 1, 1);
110  placer(0, n++, mSubjectLabel, 1, 1);
111  if (message->money != 0)
112  {
113  mMoneyLabel = new Label(this, strprintf("%s %u",
114  // TRANSLATORS: mail view window label
115  _("Money:"),
116  CAST_U32(message->money)));
117  placer(0, n++, mMoneyLabel, 1, 1);
118  }
119  placer(0, n++, mMessageLabel, 1, 1);
120  placer(0, n++, mItemScrollArea, 1, 1);
122  if (mUseMail2 && message->money != 0)
123  {
124  mGetMoneyButton = new Button(this,
125  // TRANSLATORS: mail view attached money button
126  _("Get money"),
127  "money",
129  this);
130  placer(0, n++, mGetMoneyButton, 1, 1);
131  }
132  placer(0, n++, mGetAttachButton, 1, 1);
135  ContainerPlacer placer2(nullptr, nullptr);
136  placer2 = getPlacer(0, n);
138  placer2(0, 0, mPrevButton, 1, 1);
139  placer2(1, 0, mNextButton, 1, 1);
140  placer2(3, 0, mReplyButton, 1, 1);
141  placer2(4, 0, mCloseButton, 1, 1);
143  loadWindowState();
144  enableVisibleSound(true);
145 }
#define CAST_U32
Definition: cast.h:30
void setDefaultSize()
Definition: window.cpp:1193
Button * mPrevButton
#define _(s)
Definition: gettext.h:34
std::string text
Definition: mailmessage.h:51
bool getOptionBool(const std::string &name, const bool def) const
Definition: window.cpp:1461
const bool Visible_true
Definition: visible.h:29
std::string sender
Definition: mailmessage.h:49
Label * mTimeLabel
int64_t money
Definition: mailmessage.h:55
void loadWindowState()
Definition: window.cpp:1082
const bool ShowEmptyRows_false
Definition: showemptyrows.h:29
Inventory * mInventory
void setMinWidth(const int width)
Definition: window.cpp:586
bool Opaque
Definition: opaque.h:29
MailMessage * mMessage
Button * mGetAttachButton
Definition: button.h:96
Button * mCloseButton
ScrollArea * mItemScrollArea
Label * mSubjectLabel
void setHeight(int height)
ItemContainer * mItemContainer
Label * mMessageLabel
Settings settings
Definition: settings.cpp:31
std::string title
Definition: mailmessage.h:48
const std::string BUTTON_SKIN
Definition: button.h:88
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
Definition: label.h:87
#define fromBool(val, name)
Definition: booldefines.h:48
std::string strTime
Definition: mailmessage.h:50
Label * mMoneyLabel
Button * mGetMoneyButton
Label * mFromLabel
void setCloseButton(const bool flag)
Definition: window.cpp:744
void enableVisibleSound(bool b)
Definition: window.h:480
void setMinHeight(const int height)
Definition: window.cpp:599
ContainerPlacer getPlacer(const int x, const int y)
Definition: window.cpp:1386
void setSaveVisible(const bool save)
Definition: window.h:299
Button * mNextButton
virtual void setVisible(Visible visible)
Definition: window.cpp:773
void center()
Definition: window.cpp:1412
const bool ForceQuantity_false
Definition: forcequantity.h:29
void setResizable(const bool resize)
Definition: window.cpp:622
void setStickyButtonLock(const bool sticky)
Definition: window.cpp:767
Button * mReplyButton
bool enableNewMailSystem
Definition: settings.h:163
Window(const std::string &caption, const Modal modal, Window *const parent, std::string skin)
Definition: window.cpp:108
void setWindowName(const std::string &name)
Definition: window.h:354
void setHorizontalScrollPolicy(const ScrollPolicy hPolicy)

◆ ~MailViewWindow()

MailViewWindow::~MailViewWindow ( )

Definition at line 147 of file mailviewwindow.cpp.

References delete2, mGetMoneyButton, mInventory, mMessage, and mUseMail2.

148 {
149  if (mUseMail2)
150  {
151  mMessage = nullptr;
152  }
153  else
154  {
155  delete2(mMessage);
157  }
159  mailViewWindow = nullptr;
160 }
Inventory * mInventory
MailMessage * mMessage
MailViewWindow * mailViewWindow
#define delete2(var)
Definition: delete2.h:24
Button * mGetMoneyButton

Member Function Documentation

◆ action()

void MailViewWindow::action ( const ActionEvent actionEvent)

Called when an action is recieved from a widget. It is used to be able to recieve a notification that an action has occured.

actionEventThe event of the action.

Implements ActionListener.

Definition at line 162 of file mailviewwindow.cpp.

References CAST_S32, CREATEWIDGETV0, Net::MailHandler::getAttach(), MailWindow::getOpenType(), MailMessage::id, mail2Handler, mailEditWindow, mailHandler, mailWindow, mMessage, mUseMail2, Net::Mail2Handler::requestItems(), Net::Mail2Handler::requestMoney(), Window::scheduleDelete(), MailMessage::sender, MailEditWindow::setMessage(), MailEditWindow::setSubject(), MailEditWindow::setTo(), MailMessage::text, MailMessage::title, MailWindow::viewNext(), and MailWindow::viewPrev().

163 {
164  const std::string &eventId = event.getId();
165  if (eventId == "close")
166  {
167  scheduleDelete();
168  }
169  else if (eventId == "attach")
170  {
171  if (mUseMail2)
172  {
174  mMessage->id);
175  }
176  else
177  {
179  }
180  }
181  else if (eventId == "money")
182  {
183  if (mUseMail2)
184  {
186  mMessage->id);
187  }
188  }
189  else if (eventId == "next")
190  {
191  if (mMessage != nullptr)
193  }
194  else if (eventId == "prev")
195  {
196  if (mMessage != nullptr)
198  }
199  else if (eventId == "reply")
200  {
201  if (mMessage == nullptr)
202  return;
203  if (mailEditWindow != nullptr)
209  scheduleDelete();
210  }
211 }
#define CREATEWIDGETV0(var, type)
Definition: createwidget.h:31
std::string text
Definition: mailmessage.h:51
std::string sender
Definition: mailmessage.h:49
MailMessage * mMessage
Net::Mail2Handler * mail2Handler
Definition: net.cpp:106
void setSubject(const std::string &str)
std::string title
Definition: mailmessage.h:48
#define CAST_S32
Definition: cast.h:29
MailOpenTypeT getOpenType() const
Definition: mailwindow.h:78
void setMessage(const std::string &str)
virtual void requestMoney(const MailOpenTypeT openType, const int64_t mailId) const =0
void setTo(const std::string &str)
Net::MailHandler * mailHandler
Definition: net.cpp:107
virtual void scheduleDelete()
Definition: window.cpp:826
virtual void getAttach(const int msgId) const =0
virtual void requestItems(const MailOpenTypeT openType, const int64_t mailId) const =0
void viewNext(const int64_t id)
Definition: mailwindow.cpp:272
MailWindow * mailWindow
Definition: mailwindow.cpp:53
MailEditWindow * mailEditWindow
void viewPrev(const int64_t id)
Definition: mailwindow.cpp:300
int64_t id
Definition: mailmessage.h:52

◆ getInventory()

Inventory * MailViewWindow::getInventory ( ) const

Definition at line 213 of file mailviewwindow.cpp.

References mInventory.

Referenced by EAthena::MailRecv::processReadMail(), and EAthena::Mail2Recv::processReadMail().

214 {
215  return mInventory;
216 }
Inventory * mInventory

◆ removeItems()

void MailViewWindow::removeItems ( const int64_t  mailId)

Definition at line 237 of file mailviewwindow.cpp.

References CAST_S32, Inventory::clear(), MailMessage::id, MailMessageType::Item, mailWindow, mInventory, mMessage, MailWindow::refreshMailNames(), MailMessage::type, and updateAttachButton().

Referenced by EAthena::Mail2Recv::processRequestItems().

238 {
239  if (mailId != mMessage->id)
240  return;
241  mInventory->clear();
242  mMessage->type = static_cast<MailMessageType::Type>(
244  mMessage->type = static_cast<MailMessageType::Type>(
247  if (mailWindow != nullptr)
249 }
Inventory * mInventory
MailMessage * mMessage
void clear()
Definition: inventory.cpp:237
#define CAST_S32
Definition: cast.h:29
MailMessageType::Type type
Definition: mailmessage.h:56
void refreshMailNames()
Definition: mailwindow.cpp:384
MailWindow * mailWindow
Definition: mailwindow.cpp:53
int64_t id
Definition: mailmessage.h:52

◆ removeMoney()

void MailViewWindow::removeMoney ( const int64_t  mailId)

Definition at line 251 of file mailviewwindow.cpp.

References _, CAST_S32, MailMessage::id, mailWindow, mGetMoneyButton, mMessage, mMoneyLabel, MailMessageType::Money, MailMessage::money, MailWindow::refreshMailNames(), Label::setCaption(), Widget::setVisible(), strprintf(), MailMessage::type, and Visible_false.

Referenced by EAthena::Mail2Recv::processRequestMoney().

252 {
253  if (mailId != mMessage->id)
254  return;
255  mMessage->type = static_cast<MailMessageType::Type>(
257  mMessage->type = static_cast<MailMessageType::Type>(
260  mMessage->money = 0;
262  if (mMoneyLabel == nullptr)
263  return;
265  if (mGetMoneyButton != nullptr)
269  // TRANSLATORS: mail view window label
270  _("Money:"),
271  0));
272  if (mailWindow != nullptr)
274 }
#define _(s)
Definition: gettext.h:34
int64_t money
Definition: mailmessage.h:55
void setVisible(Visible visible)
Definition: widget.cpp:224
MailMessage * mMessage
#define CAST_S32
Definition: cast.h:29
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
void setCaption(const std::string &caption)
Definition: label.cpp:261
const bool Visible_false
Definition: visible.h:29
MailMessageType::Type type
Definition: mailmessage.h:56
Label * mMoneyLabel
Button * mGetMoneyButton
void refreshMailNames()
Definition: mailwindow.cpp:384
MailWindow * mailWindow
Definition: mailwindow.cpp:53
int64_t id
Definition: mailmessage.h:52

◆ updateAttachButton()

void MailViewWindow::updateAttachButton ( )

Definition at line 218 of file mailviewwindow.cpp.

References Inventory::getLastUsedSlot(), mGetAttachButton, mInventory, mMessage, MailMessage::money, mUseMail2, Widget::setVisible(), Visible_false, and Visible_true.

Referenced by MailViewWindow(), removeItems(), and updateItems().

219 {
220  if ((mMessage->money != 0 && !mUseMail2) ||
221  mInventory->getLastUsedSlot() != -1)
222  {
224  }
225  else
226  {
228  }
229 }
const bool Visible_true
Definition: visible.h:29
int64_t money
Definition: mailmessage.h:55
void setVisible(Visible visible)
Definition: widget.cpp:224
Inventory * mInventory
MailMessage * mMessage
Button * mGetAttachButton
const bool Visible_false
Definition: visible.h:29
int getLastUsedSlot() const
Definition: inventory.cpp:290

◆ updateItems()

void MailViewWindow::updateItems ( )

Field Documentation

◆ mCloseButton

Button* MailViewWindow::mCloseButton

Definition at line 63 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mFromLabel

Label* MailViewWindow::mFromLabel

Definition at line 69 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mGetAttachButton

Button* MailViewWindow::mGetAttachButton

Definition at line 61 of file mailviewwindow.h.

Referenced by MailViewWindow(), and updateAttachButton().

◆ mGetMoneyButton

Button* MailViewWindow::mGetMoneyButton

Definition at line 62 of file mailviewwindow.h.

Referenced by MailViewWindow(), removeMoney(), and ~MailViewWindow().

◆ mInventory

Inventory* MailViewWindow::mInventory

Definition at line 72 of file mailviewwindow.h.

Referenced by getInventory(), removeItems(), updateAttachButton(), and ~MailViewWindow().

◆ mItemContainer

ItemContainer* MailViewWindow::mItemContainer

Definition at line 73 of file mailviewwindow.h.

Referenced by updateItems().

◆ mItemScrollArea

ScrollArea* MailViewWindow::mItemScrollArea

Definition at line 74 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mMessage

MailMessage* MailViewWindow::mMessage

◆ mMessageLabel

Label* MailViewWindow::mMessageLabel

Definition at line 71 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mMoneyLabel

Label* MailViewWindow::mMoneyLabel

Definition at line 68 of file mailviewwindow.h.

Referenced by MailViewWindow(), and removeMoney().

◆ mNextButton

Button* MailViewWindow::mNextButton

Definition at line 65 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mPrevButton

Button* MailViewWindow::mPrevButton

Definition at line 64 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mReplyButton

Button* MailViewWindow::mReplyButton

Definition at line 66 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mSubjectLabel

Label* MailViewWindow::mSubjectLabel

Definition at line 70 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mTimeLabel

Label* MailViewWindow::mTimeLabel

Definition at line 67 of file mailviewwindow.h.

Referenced by MailViewWindow().

◆ mUseMail2

bool MailViewWindow::mUseMail2

Definition at line 75 of file mailviewwindow.h.

Referenced by action(), MailViewWindow(), updateAttachButton(), and ~MailViewWindow().

The documentation for this class was generated from the following files: