OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
syslink.h
Go to the documentation of this file.
1//
2/// \file
3/// Definition of class TSysLink
4//
5// Part of OWLNext - the next generation Object Windows Library
6// Copyright (c) 2014 Vidar Hasfjord
7//
8// For more information, including license details, see
9// http://owlnext.sourceforge.net
10//
11
12#ifndef OWL_SENTRY_SYSLINK_H
13#define OWL_SENTRY_SYSLINK_H
14
15#include <owl/private/defs.h>
16#if defined(BI_HAS_PRAGMA_ONCE)
17# pragma once
18#endif
19
20#include <owl/commctrl.h>
21#include <memory>
22
23namespace owl
24{
25
26/// \addtogroup commctrl
27/// @{
28
29//
30/// Encapsulates the SysLink common control, a Windows control that provides a convenient way to
31/// embed hypertext links in a window.
32///
33/// The SysLink control is defined in version 6 of the Windows common controls, and it requires a
34/// manifest or directive that specifies that version 6 of the DLL should be used if it is
35/// available. For more information, see the Windows documentation:
36/// http://msdn.microsoft.com/en-us/library/windows/desktop/bb760704.aspx
37//
39 : public TControl
40{
41public:
42
43 TSysLink(TWindow* parent, int id, const tstring& markupText, const TRect&, TModule* module = nullptr);
44 TSysLink(TWindow* parent, int resourceId, TModule* module = nullptr);
45 explicit TSysLink(THandle hWnd, TModule* module = nullptr);
46
47 TSysLink(const TSysLink&) = delete;
48 TSysLink& operator =(const TSysLink&) = delete;
49
50 auto GetIdealHeight() -> int const;
51 auto GetIdealSize(int maxWidth, TSize& out) -> int const;
52 auto GetIdealSize(int maxWidth) -> TSize const;
53 auto GetItem(LITEM& inOut) -> bool const;
54 auto GetItem(int index) -> LITEM const;
55 auto GetId(int index) -> tstring const;
56 auto GetUrl(int index) -> tstring const;
57
58 auto SetItem(const LITEM&) -> bool;
59
60 auto HitTest(LHITTESTINFO& inOut) -> bool const;
61 auto HitTest(const TPoint&) -> std::unique_ptr<LITEM> const;
62
63protected:
64
65 // TWindow overrides
66 //
67 auto GetWindowClassName() -> TWindowClassName override;
68
69};
70
71//
72/// Derives from TSysLink and provides automatic handling of link activation.
73/// Links are followed using the ShellExecute function with the "open" command.
74//
76 : public TSysLink
77{
78public:
79
80 TAutoSysLink(TWindow* parent, int id, const tstring& markupText, const TRect&, TModule* module = nullptr);
81 TAutoSysLink(TWindow* parent, int resourceId, TModule* module = nullptr);
82 explicit TAutoSysLink(THandle hWnd, TModule* module = nullptr);
83
84private:
85
86 // Event handlers
87 //
88 void EvFollowLink();
89
91};
92
93/// @}
94
95} // OWL namespace
96
97#endif
TControl unifies its derived control classes, such as TScrollBar, TControlGadget, and TButton.
Definition control.h:38
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
The tagSIZE struct is defined as.
Definition geometry.h:234
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
Definition module.h:47
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
HWND THandle
TWindow encapsulates an HWND.
Definition window.h:418
Definition of classes for CommonControl encapsulation.
#define DECLARE_RESPONSE_TABLE(cls)
Definition eventhan.h:436
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
std::string tstring
Definition defs.h:79
#define _OWLCLASS
Definition defs.h:338