SingleApplication/singleapplication_8h_source.html

237 lines
30 KiB
HTML
Raw Permalink Normal View History

2024-02-05 02:45:10 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- BEGIN opengraph metadata -->
<meta property="og:title" content="Doxygen Awesome" />
<meta property="og:image" content="https://repository-images.githubusercontent.com/348492097/4f16df80-88fb-11eb-9d31-4015ff22c452" />
<meta property="og:description" content="Custom CSS theme for doxygen html-documentation with lots of customization parameters." />
<meta property="og:url" content="https://jothepro.github.io/doxygen-awesome-css/" />
<!-- END opengraph metadata -->
<!-- BEGIN twitter metadata -->
<meta name="twitter:image:src" content="https://repository-images.githubusercontent.com/348492097/4f16df80-88fb-11eb-9d31-4015ff22c452" />
<meta name="twitter:title" content="Doxygen Awesome" />
<meta name="twitter:description" content="Custom CSS theme for doxygen html-documentation with lots of customization parameters." />
<!-- END twitter metadata -->
<title>SingleApplication: singleapplication.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link rel="icon" type="image/svg+xml" href="logo.drawio.svg"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript" src="toggle-alternative-theme.js"></script>
<script type="text/javascript">
DoxygenAwesomeFragmentCopyButton.init()
DoxygenAwesomeDarkModeToggle.init()
DoxygenAwesomeParagraphLink.init()
</script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- https://tholman.com/github-corners/ -->
<a href="https://github.com/itay-grudev/SingleApplication" class="github-corner" title="View source on GitHub" target="_blank">
<svg viewBox="0 0 250 250" width="40" height="40" style="position: absolute; top: 0; border: 0; right: 0; z-index: 99;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SingleApplication
</div>
<div id="projectbrief">Replacement for QtSingleApplication</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('singleapplication_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">singleapplication.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright (c) Itay Grudev 2015 - 2023</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// of this software and associated documentation files (the &quot;Software&quot;), to deal</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">// in the Software without restriction, including without limitation the rights</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">// copies of the Software, and to permit persons to whom the Software is</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// furnished to do so, subject to the following conditions:</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// Permission is not granted to use this software or any of the associated files</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// as sample data for the purposes of building machine learning models.</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment">// The above copyright notice and this permission notice shall be included in</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// all copies or substantial portions of the Software.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">// THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment">// THE SOFTWARE.</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#ifndef SINGLE_APPLICATION_H</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#define SINGLE_APPLICATION_H</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;QtCore/QtGlobal&gt;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;QtNetwork/QLocalSocket&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#ifndef QAPPLICATION_CLASS</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor"> #define QAPPLICATION_CLASS QCoreApplication</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; </div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include QT_STRINGIFY(QAPPLICATION_CLASS)</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">class </span>SingleApplicationPrivate;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classSingleApplication.html"> 43</a></span>&#160;<span class="keyword">class </span><a class="code" href="classSingleApplication.html">SingleApplication</a> : <span class="keyword">public</span> QAPPLICATION_CLASS</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;{</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; Q_OBJECT</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">using</span> app_t = QAPPLICATION_CLASS;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f"> 59</a></span>&#160; <span class="keyword">enum</span> <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f">Mode</a> {</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa17303c0281bc4e2fb3828c2ed4bcf795"> 63</a></span>&#160; <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa17303c0281bc4e2fb3828c2ed4bcf795">User</a> = 1 &lt;&lt; 0,</div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa3a5bcecf2993a8a3e108e10b7819c2c3"> 67</a></span>&#160; <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa3a5bcecf2993a8a3e108e10b7819c2c3">System</a> = 1 &lt;&lt; 1,</div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fae9f77ee5f0c937af0a65b95c25027653"> 71</a></span>&#160; <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fae9f77ee5f0c937af0a65b95c25027653">SecondaryNotification</a> = 1 &lt;&lt; 2,</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa7b64a607dead1807e099f68c22ea0014"> 75</a></span>&#160; <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa7b64a607dead1807e099f68c22ea0014">ExcludeAppVersion</a> = 1 &lt;&lt; 3,</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa803baaaf15d8c409637cffdedc14173c">ExcludeAppPath</a> = 1 &lt;&lt; 4</div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa803baaaf15d8c409637cffdedc14173c"> 80</a></span>&#160; };</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; Q_DECLARE_FLAGS(Options, <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f">Mode</a>)</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a559ac42e5b41d257eb33d010756eee61"> 103</a></span>&#160; explicit <a class="code" href="classSingleApplication.html">SingleApplication</a>( <span class="keywordtype">int</span> &amp;argc, <span class="keywordtype">char</span> *argv[], <span class="keywordtype">bool</span> allowSecondary = false, Options options = <a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f">Mode</a>::<a class="code" href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa17303c0281bc4e2fb3828c2ed4bcf795">User</a>, <span class="keywordtype">int</span> timeout = 1000, const QString &amp;<a class="code" href="classSingleApplication.html#a4ab1f96fb881f7c35639eb6f2572535e">userData</a> = {} );</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; ~<a class="code" href="classSingleApplication.html">SingleApplication</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a36af8526d9c0aead9e2fb4c6e1ef532d"> 110</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classSingleApplication.html#a36af8526d9c0aead9e2fb4c6e1ef532d">isPrimary</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a2da2bd95ebb216d36efcfe61f6684fbd"> 116</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classSingleApplication.html#a2da2bd95ebb216d36efcfe61f6684fbd">isSecondary</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classSingleApplication.html#ac0c288b9fcc6db6abf0977c7fe102189"> 122</a></span>&#160; quint32 <a class="code" href="classSingleApplication.html#ac0c288b9fcc6db6abf0977c7fe102189">instanceId</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a7daa49ae816cbb2522af9dddf18cd103"> 128</a></span>&#160; qint64 <a class="code" href="classSingleApplication.html#a7daa49ae816cbb2522af9dddf18cd103">primaryPid</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classSingleApplication.html#aaac54339fe4046596b56980ddc5d93f3"> 134</a></span>&#160; QString <a class="code" href="classSingleApplication.html#aaac54339fe4046596b56980ddc5d93f3">primaryUser</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; </div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a0a4a6c59b97053140412b39837fa5cd4"> 140</a></span>&#160; QString <a class="code" href="classSingleApplication.html#a0a4a6c59b97053140412b39837fa5cd4">currentUser</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd"> 145</a></span>&#160; <span class="keyword">enum</span> <a class="code" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">SendMode</a> {</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; NonBlocking, </div>
<div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bda838535d1d486f2536110a4d20687b305"> 147</a></span>&#160; <a class="code" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bda838535d1d486f2536110a4d20687b305">BlockUntilPrimaryExit</a>, </div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; };</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; </div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="classSingleApplication.html#aefbc2f33e22cbdcdafdfbf132b9d9ef1"> 158</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classSingleApplication.html#aefbc2f33e22cbdcdafdfbf132b9d9ef1">sendMessage</a>( <span class="keyword">const</span> QByteArray &amp;message, <span class="keywordtype">int</span> timeout = 100, <a class="code" href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">SendMode</a> sendMode = NonBlocking );</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; </div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a4ab1f96fb881f7c35639eb6f2572535e"> 164</a></span>&#160; QStringList <a class="code" href="classSingleApplication.html#a4ab1f96fb881f7c35639eb6f2572535e">userData</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;Q_SIGNALS:</div>
<div class="line"><a name="l00171"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a1aaf2ba6e56fc03638d283d7a39584b1"> 171</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classSingleApplication.html#a1aaf2ba6e56fc03638d283d7a39584b1">instanceStarted</a>();</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; </div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classSingleApplication.html#a140e450a0d701fab720403e3eeb15715"> 176</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classSingleApplication.html#a140e450a0d701fab720403e3eeb15715">receivedMessage</a>( quint32 <a class="code" href="classSingleApplication.html#ac0c288b9fcc6db6abf0977c7fe102189">instanceId</a>, QByteArray message );</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; SingleApplicationPrivate *d_ptr;</div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; Q_DECLARE_PRIVATE(<a class="code" href="classSingleApplication.html">SingleApplication</a>)</div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="keywordtype">void</span> abortSafely();</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;};</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;Q_DECLARE_OPERATORS_FOR_FLAGS(SingleApplication::Options)</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// SINGLE_APPLICATION_H</span></div>
<div class="ttc" id="aclassSingleApplication_html"><div class="ttname"><a href="classSingleApplication.html">SingleApplication</a></div><div class="ttdoc">Handles multiple instances of the same Application.</div><div class="ttdef"><b>Definition:</b> singleapplication.h:44</div></div>
<div class="ttc" id="aclassSingleApplication_html_a0a4a6c59b97053140412b39837fa5cd4"><div class="ttname"><a href="classSingleApplication.html#a0a4a6c59b97053140412b39837fa5cd4">SingleApplication::currentUser</a></div><div class="ttdeci">QString currentUser() const</div><div class="ttdoc">Returns the username of the current user.</div></div>
<div class="ttc" id="aclassSingleApplication_html_a140e450a0d701fab720403e3eeb15715"><div class="ttname"><a href="classSingleApplication.html#a140e450a0d701fab720403e3eeb15715">SingleApplication::receivedMessage</a></div><div class="ttdeci">void receivedMessage(quint32 instanceId, QByteArray message)</div><div class="ttdoc">Triggered whenever there is a message received from a secondary instance.</div></div>
<div class="ttc" id="aclassSingleApplication_html_a1aaf2ba6e56fc03638d283d7a39584b1"><div class="ttname"><a href="classSingleApplication.html#a1aaf2ba6e56fc03638d283d7a39584b1">SingleApplication::instanceStarted</a></div><div class="ttdeci">void instanceStarted()</div><div class="ttdoc">Triggered whenever a new instance had been started, except for secondary instances if the Mode::Secon...</div></div>
<div class="ttc" id="aclassSingleApplication_html_a24f22117a871632e5a9da06734b262bd"><div class="ttname"><a href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bd">SingleApplication::SendMode</a></div><div class="ttdeci">SendMode</div><div class="ttdoc">Mode of operation of sendMessage.</div><div class="ttdef"><b>Definition:</b> singleapplication.h:145</div></div>
<div class="ttc" id="aclassSingleApplication_html_a24f22117a871632e5a9da06734b262bda838535d1d486f2536110a4d20687b305"><div class="ttname"><a href="classSingleApplication.html#a24f22117a871632e5a9da06734b262bda838535d1d486f2536110a4d20687b305">SingleApplication::BlockUntilPrimaryExit</a></div><div class="ttdeci">@ BlockUntilPrimaryExit</div><div class="ttdef"><b>Definition:</b> singleapplication.h:147</div></div>
<div class="ttc" id="aclassSingleApplication_html_a2da2bd95ebb216d36efcfe61f6684fbd"><div class="ttname"><a href="classSingleApplication.html#a2da2bd95ebb216d36efcfe61f6684fbd">SingleApplication::isSecondary</a></div><div class="ttdeci">bool isSecondary() const</div><div class="ttdoc">Checks if the instance is a secondary instance.</div></div>
<div class="ttc" id="aclassSingleApplication_html_a36af8526d9c0aead9e2fb4c6e1ef532d"><div class="ttname"><a href="classSingleApplication.html#a36af8526d9c0aead9e2fb4c6e1ef532d">SingleApplication::isPrimary</a></div><div class="ttdeci">bool isPrimary() const</div><div class="ttdoc">Checks if the instance is primary instance.</div></div>
<div class="ttc" id="aclassSingleApplication_html_a4ab1f96fb881f7c35639eb6f2572535e"><div class="ttname"><a href="classSingleApplication.html#a4ab1f96fb881f7c35639eb6f2572535e">SingleApplication::userData</a></div><div class="ttdeci">QStringList userData() const</div><div class="ttdoc">Get the set user data.</div></div>
<div class="ttc" id="aclassSingleApplication_html_a7daa49ae816cbb2522af9dddf18cd103"><div class="ttname"><a href="classSingleApplication.html#a7daa49ae816cbb2522af9dddf18cd103">SingleApplication::primaryPid</a></div><div class="ttdeci">qint64 primaryPid() const</div><div class="ttdoc">Returns the process ID (PID) of the primary instance.</div></div>
<div class="ttc" id="aclassSingleApplication_html_aaac54339fe4046596b56980ddc5d93f3"><div class="ttname"><a href="classSingleApplication.html#aaac54339fe4046596b56980ddc5d93f3">SingleApplication::primaryUser</a></div><div class="ttdeci">QString primaryUser() const</div><div class="ttdoc">Returns the username of the user running the primary instance.</div></div>
<div class="ttc" id="aclassSingleApplication_html_ac0c288b9fcc6db6abf0977c7fe102189"><div class="ttname"><a href="classSingleApplication.html#ac0c288b9fcc6db6abf0977c7fe102189">SingleApplication::instanceId</a></div><div class="ttdeci">quint32 instanceId() const</div><div class="ttdoc">Returns a unique identifier for the current instance.</div></div>
<div class="ttc" id="aclassSingleApplication_html_aefbc2f33e22cbdcdafdfbf132b9d9ef1"><div class="ttname"><a href="classSingleApplication.html#aefbc2f33e22cbdcdafdfbf132b9d9ef1">SingleApplication::sendMessage</a></div><div class="ttdeci">bool sendMessage(const QByteArray &amp;message, int timeout=100, SendMode sendMode=NonBlocking)</div><div class="ttdoc">Sends a message to the primary instance.</div></div>
<div class="ttc" id="aclassSingleApplication_html_af627160aff1baf822780f3232e43cc3f"><div class="ttname"><a href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3f">SingleApplication::Mode</a></div><div class="ttdeci">Mode</div><div class="ttdoc">Mode of operation of SingleApplication. Whether the block should be user-wide or system-wide and whet...</div><div class="ttdef"><b>Definition:</b> singleapplication.h:59</div></div>
<div class="ttc" id="aclassSingleApplication_html_af627160aff1baf822780f3232e43cc3fa17303c0281bc4e2fb3828c2ed4bcf795"><div class="ttname"><a href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa17303c0281bc4e2fb3828c2ed4bcf795">SingleApplication::User</a></div><div class="ttdeci">@ User</div><div class="ttdef"><b>Definition:</b> singleapplication.h:63</div></div>
<div class="ttc" id="aclassSingleApplication_html_af627160aff1baf822780f3232e43cc3fa3a5bcecf2993a8a3e108e10b7819c2c3"><div class="ttname"><a href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa3a5bcecf2993a8a3e108e10b7819c2c3">SingleApplication::System</a></div><div class="ttdeci">@ System</div><div class="ttdef"><b>Definition:</b> singleapplication.h:67</div></div>
<div class="ttc" id="aclassSingleApplication_html_af627160aff1baf822780f3232e43cc3fa7b64a607dead1807e099f68c22ea0014"><div class="ttname"><a href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa7b64a607dead1807e099f68c22ea0014">SingleApplication::ExcludeAppVersion</a></div><div class="ttdeci">@ ExcludeAppVersion</div><div class="ttdef"><b>Definition:</b> singleapplication.h:75</div></div>
<div class="ttc" id="aclassSingleApplication_html_af627160aff1baf822780f3232e43cc3fa803baaaf15d8c409637cffdedc14173c"><div class="ttname"><a href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fa803baaaf15d8c409637cffdedc14173c">SingleApplication::ExcludeAppPath</a></div><div class="ttdeci">@ ExcludeAppPath</div><div class="ttdef"><b>Definition:</b> singleapplication.h:79</div></div>
<div class="ttc" id="aclassSingleApplication_html_af627160aff1baf822780f3232e43cc3fae9f77ee5f0c937af0a65b95c25027653"><div class="ttname"><a href="classSingleApplication.html#af627160aff1baf822780f3232e43cc3fae9f77ee5f0c937af0a65b95c25027653">SingleApplication::SecondaryNotification</a></div><div class="ttdeci">@ SecondaryNotification</div><div class="ttdef"><b>Definition:</b> singleapplication.h:71</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><b>singleapplication.h</b></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>